Allergies could be easily explained and treated by humoral medicine. Let me explain.
The predominant systems of medical understanding before the rise of pathological-anatomical medicine (what is usually called "modern medicine") were based on the idea of "humors"--the Galenic-Islamic schools that predominated in Europe and the Middle East; the Ayurvedic school in South Asia; and the various East Asian schools that tend to (simplistically and erroneously) get lumped together under the broad heading of "Chinese herbal medicine" ("school" here referring to a collective body of thought rather than a physical location).
Humoral medicine isn't well understood anymore because it's been replaced, but it's more complex than "get the leeches." Galen proposed that the body had four humors: blood, phlegm, black bile, and yellow bile, and that these needed to be in balance or, and this is what is important, the result would be illness or susceptibility to illness caused by external factors (this latter part being relevant to the question about allergies). However, the idea of "balance" was not one size fits all: each individual had their own individual balance of humors, which could be affected by diet, weather, climate, mood, and a whole host of other factors.
Post-Galen, additional factors were added into the mix which could also involve astrology, additional humors, etc. The Ayurvedic and East Asian schools were more complex, with more humors and additional factors taken into account, but the same basic concept applies: each individual is unique and had to undertake different steps to achieve the balance of humors necessary for healthy living.
Allergies fit into this understanding of bodily health quite nicely. Allergies to substances taken internally (food or drink) or to contact with the skin were seen as what they were: the substance to which the patient is allergic upset the bodily humors and was best avoided for the maintenance of health. And, strictly speaking, there is truth to this: don't eat, drink, or apply to your skin something something you're allergic to and you won't have an issue.
Allergies to external things (dander/mold/pollen, etc.), then, were among the external factors that could negatively impact health. Part of the issue of maintaining balance was that an individual might need to avoid certain kinds of weather, or might be predisposed toward unwellness at a particular time of year (seasonal allergies), or be sensitive to certain specific environments (mold/dander). So, it could be recognized that an individual was sensitive to certain plants, animals, etc., but the exact nature of the discomfort might not be understood. This could be sometimes treated medically, or it could be treated through avoidance.
And allergies resulting from clouds of pollen ("hay fever") seemed to support the idea of miasma; that the air itself could make people unwell.
Unfortunately, there aren't a lot out of reading suggestions out there for a general audience on the humors; Lawrence Conrad's history of western medicine covers it, but he's an academic and writes like one.