Initially, I didn't search this topic (and I'm not vegan, although some of my family members are), and so I relied on my pretty good imagination.... Therefore my first answer was this:
Aren't there possibilities with many vegetarian foods that some tiny, unseen unknowns could be ingested along with the nutritious vegetable? And, on the other hand, what I am guessing about figs (which I actually do enjoy) may not be true of every individual fig you eat - right? So why not assume that the ones you eat are free of any possible, but uncertain, problems?
Sometimes it's better not to know every last detail of the foods we eat, as long as they are safe and healthy.
/ / / / /
Then I gave in and looked up the topic.
There are two things that should reassure you. First, there are some commercial varieties of figs that are self-fertilizing and are not visited by wasps. Second, each specific variety of figs is visited and pollinated only by a specific variety of wasp. If a fig tree is grown outside the area where "its wasps" live, then it will be wasp-free.
The whole topic of pollination of figs is very complicated, much too complicated for me to try to explain here, even if I knew that I had actually understood it 100%!