It's the classic German Stoßlüften in action.
However, the air outside also has lots of dusts. Opening the windows does nothing for that, but air filtration can potentially help.
And rain? What's the problem with opening a window when it's raining? Only if there's a rain storm... and not even then, depending on wind direction.
You have heard of air pollution, I assume. Some schools are in places that regularly have polluted air.