No, it is not fair to say you are allergic to food items that make you gag. It is, however, perfectly reasonable to say “My goodness, are there onions in this? I’m afraid that onions just really do not agree with me.” If your host is a reasonably polite person, they will simply indicate whether or not you need be concerned.
If pressed, you don’t have to say anything more than that whatever food it is doesn’t agree with you. Everyone has food items that just don’t cooperate with their digestive system, so everyone understands it. The few times I’ve run across someone who wanted to foist their dish containing an item that doesn’t agree with me, I’ve found that firmly repeating “Onions (or whatever) just don’t agree with me, I’m afraid” and making a vague gesture to my abdomen did the trick.
The difference between “doesn’t agree with me” and “allergic” is basically that if I’m preparing food for someone allergic to a food item, I will make triple-damn sure none of the allergen interacts in any way with the food items I plan to serve the allergic person. If it’s a case of “doesn’t agree with me”, then I will still give a fair warning, and if I know about it in advance I will strive to avoid the food item, but I won’t feel obligated to have the same level of vigilance and separation.
For example, when baking Christmas cookies that I give out as courtesy gifts to a number of professional colleagues and the like, the batch I bake for the guy in my office whose children have nut allergies gets prepared FIRST (before the others) when all my baking apparatus is absolutely pristine and has not been used at all since the last full dishwasher scrubbing wash. It then gets boxed up and moved out of the kitchen prep area before I start on the other cookies - because I want to be DAMN sure that no nuts get in there accidentally. Then I bake the rest of them. When I’m doing a major cooking prep, I can’t guarantee that the measuring cup I use for nuts for one batch won’t get re-used for flour or sugar for another (both being dry ingredients and me only possessing two measuring cups - I use one for wet and one for dry and rinse the wet one between - but only rinse, not scrub clean). The only way to be sure is to do the ones that have to be allergen-free separately and first. If my co-worker’s kids just didn’t like nuts (or nuts didn’t agree with them in a totally non-fatal manner), I would just warn my co-worker as I handed over the cookie tin that some cookies had nuts in them (and specify which cookies of course - I’m not an asshole).
I won’t be offended if, for example, someone refrains from eating the green bean casserole because green beans don’t agree with them, nor will I try to force a food item on someone who doesn’t care for it (because, good manners, yo), but when there’s a potential for death, I’m going to exercise considerably more care than if there’s just a potential for nausea. I will, however, be pissy if someone falsely claims an allergy when they just don’t like a certain food (or it makes them gag or hurl or whatever). Avoiding an allergy is an entirely different kettle of fish than avoiding a “doesn’t care for/doesn’t agree with me” situation.
