For peanuts specifically, early childhood exposure is pretty well validated to reduce allergy incidence at this point [0]. It's by far the most well validated case of the allergen exposure hypothesis. Interestingly, for the high-risk subset of children, early exposure is likely to increases incidence. Children with conditions like eczema, where the skin barrier is broken and allowing peanut proteins to get through the skin rather than purely orally, is thought to be an allergy development risk factor.
[0] https://scholar.google.com/scholar?hl=en&as_sdt=0%2C38&q=ear...