Indeed it is, although "nasty" isn't the word I'd use. We moved out of Bangkok, but where we live now is currently almost as bad. I'm too old now to move to another country and getting visa for my (Lao) wife would be difficult even if we wanted to. Going to our home in Laos isn't much better in terms of air quality, and I wouldn't be able to work as easily there nor would the quality of eduction for my son be as good.
I appreciate your concern, which I'm sure is genuine. However like tens of millions of other people who are raising their family in Thailand I'll put up with it.