Children who have been breastfed are less likely to have allergies. In addition, a mother who avoids cow's milk, eggs, nuts, and peanuts while breastfeeding can prevent allergy-related conditions, including eczema, in some children.
If there is a family history of eczema and allergies it is wise to discuss the implications for infant feeding with your child's doctor. The timing of introduction of solid foods in general, as well as of several specific foods, can help prevent some allergies.
There is also evidence that infants exposed to certain airborne allergens (such as dust mites and cat dander) may be less likely to develop related allergies. This is called the "hygiene hypothesis" and sprang from observations that infants on farms tend to have fewer allergies than those who grow up in environments that are more sterile.
Once allergies have developed, treating the allergies and carefully avoiding those things that cause reactions can prevent allergies in the future.
Christodoulopoulos P, Tulic MK, Kontolemos M, Hamid Q. Immunopathology of Allergic Airway Inflammation.In: Middleton's Allergy: Principles and Practice. 6th ed. St. Louis, Mo: Mosby; 2003; 501-511.
Goldman L, Ausiello D. Cecil Textbook of Medicine, 22nd ed. Philadelphia, Pa: WB Saunders; 2004:1590-1591.