If you have an allergy to a sulfa medication you should avoid sulfa medications.
However, since sulfonamides are usually used in medication and not in food, that does not necessarily mean you need to avoid foods. Separate issue: even though sulfa is different than sulfites used to preserve foods, sometimes a person who has a sulfa allergy might also have an allergy to sulfites in foods. Some foods you can find sulfites in include: sauerkraut, wine, different kinds of shell fish and dried fruits. If you react to any of these; i suggest you speak with an allergist so that you can be formally tested.