Why did the pharmacist ask me if I had an egg allergy before administering a flu shot?

Flu vaccine. Flu vaccine contains egg substrate. Hence the pharmacist wants to know whether you are allergic to it.
Tiny amt in vaccine. Injected flu vaccine begins its life growing in culture (planted) using chicken eggs as a host medium. A tiny amount of egg protein may be in each dose & some recommend that anyone with a major egg reaction ( generalized hives, short of breath, abdominal pain) avoid the vaccine. Those with minimal reactions usually do ok with it.