This reasoning seems to work for some cases and not others, so there might be a ton of other factors, potentially more impacting depending on your situation and genes. The article points at food and other immune elements (e.g. smoking, so I assume pollution also) for instance.
For instance Japan has a known pollen problem. There there's no correlated action to keep small kids out of pollen (that would mean masks, not playing outside at school etc. which are measures extremely hard to take), nor to prevent anyone from getting pollen if they're not known allergics. They go to school and have to be outside for significant time.
Yet the allergy rate increased twofold in a decade, as the pollen presence also increased.
For instance Japan has a known pollen problem. There there's no correlated action to keep small kids out of pollen (that would mean masks, not playing outside at school etc. which are measures extremely hard to take), nor to prevent anyone from getting pollen if they're not known allergics. They go to school and have to be outside for significant time.
Yet the allergy rate increased twofold in a decade, as the pollen presence also increased.
https://www.asahi.com/sp/ajw/articles/15622459