Parents of those in the Dunedin study reported their children's thumb-sucking and nail-biting habits when their children were aged 5, 7, 9 and 11.
Those in the study were checked at 13 and 32 for atopic sensitisation - a positive skin-prick test to at least one common allergen.
At 13, the prevalence of sensitisation was lower among children who had sucked their thumbs or bitten their nails. Just over a third had a positive skin-prick test to at least one common allergen, compared to 49 per cent for those who had not sucked their thumbs or bitten their nails.
Children who had both bitten their nails and sucked their thumbs had an even lower risk of allergy -- 31 per cent, Hancox said.
The associations were still present at age 32 and persisted even with adjustments for factors such as sex, parental history of allergies, pet ownership, breast-feeding and parental smoking, he said.
"The findings support the 'hygiene hypothesis', which suggests that being exposed to microbes as a child reduces your risk of developing allergies."
Despite the findings, those behind the study did not suggest children be encouraged to take up thumb-sucking or nail-biting. It was unclear if there was a true health benefit, Hancox said.
Medical student Stephanie Lynch, who undertook the study as a summer project, said although thumb-suckers and nail-biters had fewer allergies on skin-testing, they found no difference in their risk for developing allergic diseases, such as asthma or hay fever.
The Dunedin Multidisciplinary Health and Development Research Unit, which runs the multidisciplinary study, is supported by the Health Research Council of New Zealand.