I don't generally judge people and even when I do I don't make my thoughts known, but I've been curious about this myself. I've never experienced a food allergy, nor has any of my family members, but I've seen people claim allergies to peanuts and even bananas. I don't know if its for attention or because they don't like that particular food or if it's a true problem.
Some people fake food allergies just for attention, but not all of them. There are some people who pathologically lie because they want attention centered on them. Getting attention goes back to childhoods where it was perceived that some kids weren't hugged enough or weren't listened to by their parents. If it's not a food allergy causing the problem, there is still some problem to get to the bottom of with regards to faking food allergies for attention.
No, I do not think people fake food allergies just for attention. If you have ever seen someone who eats something that they are allergic to, it can be an very scary situation to be in, with their throats beginning to swell shut, and they break out in red all over.
I don't think some people actually fake food allergies for attention. Food allergies are widespread, and are not limited to only tree nuts, soy, and corn. There are people allergic to citrus, mushrooms, tomatoes, etc. People always seem to be mentioning a food allergy, and that makes others think they are faking, when in reality allergies are simply highly common in the population.
I do not think that people fake food allergies for attention, I do not think that will really get them a lot of attention and any it would get them probably isn't the type they would want. I do believe some people will over exaggerate it though if they do not like the food being served.