Migraines are caused by genetic makeup but can be precipitated by many factors including food allergy. The genetic science of migraine is very complex and still evolving. Suffice it to say that it can be monogenetic or polygenetic. Monogenetic means a single gene causes the individual to be prone to migraines whereas polygenetic means a whole variety of genes can play a role.
Migraine headache has a complex physiology that involves vascular (blood vessel) changes, electrical changes, and chemical changes (especially involving neurotransmitters) in the brain. If an individual inherits genes that impact two or more of these mechanisms then they tend to have greater difficulties with the headaches.
It has been known for a long time that certain foods can trigger migraines separate from the issue of food allergy. These foods exert their effect via one of the three mechanisms: vascular, electrical, or chemical. And the list includes: chocolate, cheese, liver, beer, wine, vinegar, nuts, mushrooms, smoked and pickled meat/fish, beef concentrates (bouillon), eggs, yoghurt, soy sauce, MSG and foods containing nitrites (bacon, hot dogs, etc.).
These foods have potential to affect any individual with migraines. It is probably best to add caffeine to the list in that either withdrawal from caffeine or variations in intake of caffeine can cause migraines.
With respect to food allergy this would only apply to individuals who are atopic. And any given food has a potential to precipitate migraine. The basis for food allergy and migraine is a function of the release of histamines and inflammatory molecules from ingesting the allergic food.
One good way to ferret food-headache issues is to keep a diet/headache diary. Sometimes its combinations of foods that create a problem, not single exposures. A diet diary is very helpful in gaining this type of insight.