A Phobia or Fear of hats or headgear, perhaps what is under them, or of wearing them.
The opposite of this would be the love or fetish of hats kapelophile which likely stems from the French
words chapeau, chapeaux, chapeaus, capel or chapel which originate from the
Latin word cappellum "hood, hat", the diminutive of cappa "hooded cloak", which is also where cap pulls it's original meaning from.
Thus, you could extrapolate kapelophobia or chapeauphobia, chapeauphile could just as well be valid
words.. if you are creative like that, and they sound a more appropriate than... cock-laphobia
We seem to be lacking good
long fancy
words for hat, which is a real shame. *tips hat*