this is an interesting analogy
it breaks down at two levels
1) Mosquitos have the capability to sense the difference between a solid object (the link in a fence) and the empty space between the links. And they will fly through the empty space and avoid the links. A virus or aerosol particle lacks this capability.
2) The ratio of links in a fence to empty space between links is quite low. In contrast, the ratio of strands of fiber in a mask to the empty space between strands of fiber is quite high. Of course, sometimes the virus will get through a gap between the strands of fiber. No one has claimed that masks are perfect. But quite a high proportion of virus expelled when we breath or talk ends up colliding with strands of fiber.