Scientists think that some people inherit a tendency to be allergic from one or both parents. This means they are more likely to have allergies. They probably, however, do not inherit a tendency to be allergic to any specific allergen. Children are more likely to develop allergies if one or both parents have allergies. In addition, exposure to allergens at times when the body’s defenses are lowered or weakened, such as after a viral infection or during pregnancy, seems to contribute to developing allergies.
Courtesy: National Institute of Allergy and Infectious Diseases