Welcome in H.C.M.
I read your query regarding pain in ear after wearing glasses, and this pain is behind the ears.
Though for cofirmation clinical examination is must but most likely you are having some dermatitis
behind your ears due to chronic irritation by frame of glasses.
to treat it avoid glasses for sometimes and use antiseptic cream having steroides for some times.