The National Institute of Health is not so sure:
"Possible explanations for the lower prevalence of hay fever, asthma and allergic sensitization in children living on a farm might be the development of immunotolerance or the stimulation of TH1 cells and suppression of TH2 cells by increased exposure of farm children to microbial antigens in the stables or farmhouses."
http://www.ncbi.nlm.nih.gov/pubmed/10651771
I have a “possible explanation” for the National Institute of Health. Maybe the more allergic farm children died young and didn’t pass on their allergic genes to their off spring. I know I certainly could have died from several of the asthma attacks I had as a child but fortunately there was an ER and I got treatment.