Head sweating and flushing after eating or just smelling or thinking about a certain food is called gustatory sweating.
MedicineNet:
Gustatory sweating: Sweating on the forehead, face, scalp, and neck
occurring soon after ingesting food. Some gustatory sweating is normal
after eating hot, spicy foods. Otherwise, gustatory sweating is most
commonly a result of damage to a nerve that goes to the parotid gland,
the large salivary gland in the cheek. In this setting, referred to as
Frey syndrome, the sweating is usually on one side of the head.
Gustatory sweating is also a rare complication of diabetes mellitus.
In this case sweating may occur on both sides of the head, with mild
or substantial severity.
Medical News Today has an easy to read article about Frey syndrome and other types of gustatory sweating. The main point is that the nerve that supplies the parotid gland is affected in some way: congenitally, by trauma, surgery, tumor, etc.
There are several reports about such sweating triggered by sour foods, orange juice, tomatoes, onions, candies, various snacks...(PubMed) and there are several articles about Frey syndrome.
A doctor can make a diagnosis of Frey syndrome by performing a simple iodine-starch test.
Treatment is by removal of an underlying cause, but often no cause can be identified.
Food allergy or intolerance to histamine can cause head sweating, usually associated with itching around the mouth and in the throat (Better Health Channel).