It is important to understand the essence of what exactly an allergy is. Allergy is when some harmless product / substance is perceived by the body as foreign organisms attacking it. Take, for example, lactose allergy. If a person drinks milk, lactose will begin to be absorbed by the body. And at this moment, the immune system begins to attack the body in order to overcome what it considers an illness.
It is most likely possible to cure such a predisposition genetically at the stage of fetal development by means of genetic engineering. But not a cure.
A cure can also turn off the immune system. Then the body will not attack itself, but at such moments it will not attack any real ailments.
It is important to understand what you mean by "allergy medicine". In general, I agree that all modern drugs called antiallergic do not eliminate the disease itself, but still affect not the symptoms, but the mechanisms
and it is very difficult to influence the causes of allergies, alas.