If I interpret it correctly, our skin is a pattern recognition engine, just like our eyes and ears and taste-buds. When something bad happens (e.g. the skin is broken), the surrounding skin does it's best to detect the types of chemicals that were present during the break-in. If the body eventually goes into reaction mode, the skin 'learns' that the trace chemical is a harbinger of doom. Thus if the skin ever detects that chemical signature again, it triggers an early warning system that shuts the whole body down (putting it into bacteria-fighting mode, for example). The problem is that this happens all over the body, not just in the affected area. The common most troublesome result is the restriction of the breathing passages. *anaphylactic shock*
The research suggests worms invading our intestines is a common historic problem for humans, and a good use-case for this pattern detection system.
Things like peanut/laxative/pollen/dust/etc allergies, etc imply similar skin-response patterns.. At some point, you are not allergic, then later on in life (possibly still in child-hood) you are.
A series of bee stings is an unfortunate good example. many pricks by bees/hornets on different parts of the body.. A very unique chemical signature is detected, along the skin lesion - the body will be ready to globally react next time it detects even the 1st protrusion.
Now, to take a lesson from email spam scanning. You don't treat an email flagged as spam as forever bad... You augment a probability model. If you've historically flagged an email as ham then this on email may just be an anomaly.. But if there is a burst of spam, the probability model can swing. But there is a manual ham button to compensate when the burst is over, swinging the probability back.
The human body should have such a trigger... If the FIRST experience with a chemical is bad.. Then sure, proteins are unique-enough, it may be the scent of a pathogen. But if you've "been eating peanut butter your whole life", and one day you have a nasty pathogen, and there are traces of peanut butter around the damage point... The body SHOULD be able to quorum vote and tell the mast cell to go F itself.
But since we socially learn that peanut butter MIGHT cause anaphylactic shock, we keep our children away from potentially reactive chemicals. Thus the first time they do encounter it, may be amidst a pathogen (say an allergy test) or some restaurant food that doesn't settle well with us.
I grew up dirty as a boy could be. No anti-bacterial. And some other unspeakables. I'd eat raw uncooked foods when my mother wasn't looking. I grew up on processed foods; antibiotics, vaccines, what-have-you. So I should be dying of cancer by this point according to Organic literature. But I speculate the opposite. The constant barrage of spam so to speak is training my body that certain chemicals are regularly present when I'm still healthy, and training them that they're also pre-present when I'm sick as a dog. So my immune system is able to filter out the noise and attach legit pathogens.
I definitely lost some of this correctly targeted immune system when I left college and worked in the big city - using antibacterial soap, not being outside much, etc. My allergies came out of no-where. But now that I have "dirty" children surrounding me, I see my immunity getting better. My throat-and-gum-swelling due to eating an entire carton of peanuts is starting to go lesson (I'm hamming that damn allergy out of existence - so to speak).
So like unwanted email, I believe our allergies are correctable. Helicopter parenting not withstanding.