Yes. Allergies can and do result in swelling, also known as angioedema. This can be brought on by inhalation, topical exposure or ingestion of the allergen.
Food allergies usually result in hives or swelling of the tongue and neck. If the onion comes in contact with the neck, it would not be unusual to see such a reaction.