I get severe headache when I smell red onions. Is this an allergic reaction?

No. This is an irritant reaction but does not represent an actual food allergy. Food allergy reactions are more likely to present with a combination of the following: rash or hives (the most common symptoms), swelling of lips, tongue, or throat, respiratory symptoms, vomiting, or diarrhea.
Maybe but. It may also be an intolerance. Either way the only treatment is avoidance. Sometimes cooking a food lessens such a reaction.