Prior to modern hygiene, most humans probably had worms, as well as having to constantly battle other pathogens. Immune systems had no time for peanuts in the face of these other threats.
We don't have records from the areas where peanuts were consumed prior to the 19th century (because the Spanish systematically destroyed records during the conquest of South America), so I'm not sure how we would know if there were peanut allergies prior to modern hygiene.