Not all food allergies make people go into anaphylactic shock, some of them make you gain weight, bloat, have indigestion problems, and can even make you break out. If you continue to incorporate the food, say dairy products, into your diet then your immune system is always fighting off the allergy and becomes overworked. This causes inflammation, which is one of the biggest contributors to weight gain.
If you are trying to lose weight, but you aren't giving up foods you have even a slight allergy to then you aren't going to get very far with losing the fat. I have a client that was losing weight very slowly. He wanted to eat cheese even though he is lactose intolerant. I immediately took him off of all dairy products and he lost 14 pounds in a matter of weeks. His body was ready to let go of the weight but it was focused on fighting off the lactose inflammation.
Food allergies and food intolerances are not the same. If you get tested to for food allergies then your blood is being tested against foods to see if there is an immune reaction. It isn't as easy to detect food intolerances. It is easiest to remove certain foods from the diet and then after a few weeks introducing it again to see if there is any reaction.