Allergies can provoke an auto immune response I believe.
We are towards the end of an elimination diet with my son who is 15 yo. He was Gluten, Dairy, Soy, Chocolate, Peanut, egg, Pea, artificial color/flav/preserv, floride free. His behaviors did not change for the better when we eliminated everything. In fact, he started to tic more. Dr thought it was withdrawal (food addition). As we added in dairy, his anxiety has possibly gotten worse. I am taking him off dairy again and then will re-introduce it. Jury is still out.
There are a lot of people that believe in GF/DF diets and do see good changes in their children both physically and behaviorally.