Allergy experts from Melbourne's Murdoch Childrens Research Institute studied more than 5000 babies and found those with young siblings and infants exposed to a dog inside the home were less likely to develop an allergic reaction to egg.
Food allergies now affect up to 10 per cent of babies, according to the study published in the journal Allergy.
The study found 10.8 per cent of infants with no siblings were allergic to egg but as the number of brothers and sisters increased the incidence of egg allergy decreased.
Meanwhile, about 10 per cent of babies in households without a dog had an egg allergy compared to only six per cent of those with a dog.
Lead researcher Dr Jennifer Koplin said the risk of developing a food allergy seemed to be a combination of genetic and environmental factors.
She said the immune system evolved at a time when people were exposed to more bacteria in food and the water supply, and infections through crowding and larger families.
Dr Koplin said it was possible developing infants were now not exposed to the right environmental factors to teach their immune systems how to react appropriately.
"They are reacting inappropriately to something that they should be able to tolerate which is in this case, food allergens, or food proteins," Dr Koplin told AAP.
The research suggested the protective effect of a family dog on egg allergy could be due to exposure to endotoxin, a type of bacteria.
Dr Koplin said endotoxin stimulates the immune system to attack bad bacteria and in doing so, is distracted from attacking harmless things in the environment like foods.
The study also found babies with a family history of allergy and those with parents born in East Asian countries like China and Vietnam are at increased risk of egg allergy.
Dr Koplin said East Asian families, as well as being genetically at higher risk of food allergy, may be exposed to different bacteria in their home countries.
"When they migrate over here and the kids are born here, they don't have that same exposure that suppresses the development of allergy," she said.
The researchers have previously shown introducing egg to infants later, at about 10 months of age, is strongly associated with the risk of egg allergy.