Actually allergies can be handled quite easily without enlarging the dwarf raws to much. Toady could just let the program add a allergy as "gene" on the creation of a dwarf. Internally the dwarf would just hold a small list with allergies that may or may not be revealed to the player and may, most likely, not have any articles at all. Genetic allergies get passed down from parent to child (50% if only one parent had the gene) - for allergies bound to genetics anyway. But lets talk about poisons in general before i go on because they have some useable traits and infrastructure for this problem.
Remember each dwarf has poison-group assigned by the tag [CREATURE_CLASS:GENERAL_POISON]. Atm this is the only poison-group in game btw. . It determines which poisons work on a being by the [SYN_AFFECTED_CLASS:GENERAL_POISON] tag in poisons itself.
The variant which i would prefer would be attaching a new token to creatures like [CREATURE_ALLERGIES:ALLERGY_ GENERAL]. Then the games goes through a list of Materials and takes all the materials that have a [SYN_ALLERGY_CLASS:ALLERGY_ GENERAL] tag and assigns material based allergies to things with a very small chance. Given that we get populations of 50K+ 0.1% chance would be actually enough chance to get an allergy assigned at creation that could be passed down to reflect the pre-industrialisation allergy levels.
The effects of the allergy can be expressed like the ones of syndromes and poisons. The severty of the effects could also be counted from a slight blister from wearing a nickel ring to an outright anaphylactic shock can all be codified with in the syndrom-system. The probability of an effect expressing itself is also within the syndrom-system but would need to attached to the dwarf only once on his creation and not each time the material is encountered.
Acquired allergies, like most cases of hay fever, could form with a very low chance and still act under the same system with a chance of say 0.01% incl the chance to acquire a resistance later/over a time. This way you can get a baker which acquires a flour allergy but he could work that off.
By the way poisons also allow to make exception to castes and certain creatures types so i figure that could aslo be added to a allergy system like the one i have outlined.