English is not my native language so I have gone through the pain of learning the difference between in, on, and at. However, it is common in the U.S. to refer to someone wearing a hat as X in the hat. A notable example is the children's book The Cat in the Hat by Dr. Seuss.
Using the latter example, we know that the cat is not inside the hat but instead the hat is on top of the cat. Why is it acceptable to say The Cat in the Hat?
Why is the expression X in the Hat acceptable?