"Unfortunately, there is not really any way to prevent children getting hay fever and we most typically see it in children who have an allergic tendency and commonly have eczema in early childhood," says Professor Fox. "Children with eczema and food allergies such as egg allergy are at particularly high risk of getting respiratory allergies such as hay fever in the order of about 80%."
Margaret Kelman of Allergy UK told GoodTo that "your child is more likely to suffer from hay fever if other close family members have allergies" and in these cases it would not be possible to prevent your child from getting hay fever.