Breastfeeding may help prevent allergies. Otherwise, there is no known prevention of food allergies except to delay introducing allergy-causing foods to infants until the gastrointestinal tract has had a chance to mature. The timing for this varies from food to food and from baby to baby.
Once an allergy has developed, carefully avoiding the offending food usually prevents further problems.
American Gastroenterological Association medical position statement: guidelines for the evaluation of food allergies. Gastroenterology. 2001 Mar;120(4):1023-5.
American College of Allergy, Asthma, & Immunology. Food allergy: a practice parameter. Ann Allergy Asthma Immunol. 2006 Mar;96(3 Suppl 2):S1-68.
Adkinson NF Jr. Middleton’s Allergy: Principles and Practice. 6th ed. Philadelphia, Pa: Mosby; 2003.