I think the lumpy blue hat from the Mario Bros is just an odd choice on the part of the artist. I don't know of any real hat that looks anything like that. As far as the reason it's blue: At this time, hardware limitations meant you were restricted in the number of colors on the sprite. You will...
I think you have to differentiate between the origin of Mario's hat, and the OP's actual question which is what real-life hat is most like Mario's hat (not Popeye's). In the real world, there is no such thing as a captain's hat, or fisherman's hat, that actually looks like Mario's hat, nor would...
All of these responses are incorrect. It is a flat cap with the front unbuttoned. Example:
https://www.amazon.com/Premium-Classic-Newsboy-Collection-Medium/dp/B09DR6CGCC/?th=1&psc=1
and:
https://www.amazon.com/Linen-Gatsby-Summer-Newsboy-Medium/dp/B07S1QFM7F/