Hats are great because you don't have to think about them. Just pick a hat you like and wear it. It can be spontaneous and simple. Personalities can be like hats in that way. They come naturally and you don't have to think about your own, like the hat you just happened to put on.
In fiction hats can be seen more symbolically, almost like the masks used in ancient Greek theater. A character's hat helps you read the character, as if the character's choice of hat shows how they want to be seen by others. In Yoshi's Paintbrush, Joshi wears a baseball cap that says "Sport" on it. I guess you could say she is 'sporting' a baseball cap (okay, so that was a weak pun). A baseball cap could be just one of many features that adds to Joshi's stereotype of herself.
I suppose you could ask yourself "What is the hat I happen to have and what does it say about me?" But my response is that I don't have to be like a fiction character and depend on what I wear to show my personality. If you want to, do as you wish. As for me, I'll continue picking a hat I happen to like and wearing it because I want something to cover my head. Sure, a bit of my personality shows whether I like it or not, but my sense of self doesn't rely on fashion.