In general, you can wear hats in casinos. When playing casino games such as roulette, you may be asked to remove your hat so that the “eye in the sky” (the cameras) can see your face. As for poker, you can wear hats in virtually all poker rooms.
Obviously, each casino has its own rules and procedures.
Typically, hats are allowed, even when playing, but don’t be surprised if a supervisor, or the dealer themselves, asks you to remove or adjust your hat.
Again, this is for security reasons (although in some cases hats may not be allowed purely because of a more formal dress code).
I have been working as a dealer in a few casinos in the UK and the rule has always been that customers are not allowed to wear hats, unless they’re playing poker, and all dealers and inspectors must be strict about this.
I’ve checked with other casinos to see what their rules are. Have a look at the following examples to get a better idea…
US casinos
I contacted three casinos in the US (one in Vegas). I asked whether hats are allowed, specifically when playing casino games.
Based on their reply, it seems the rules are a lot less strict compared to the UK. Have a look at what they said:



UK casinos
I’m not aware of any casinos in the UK that don’t enforce the hat rule.
I sent an email to a famous casino in London, and here’s what they wrote:


And here’s what the FAQ page of another casino says:

The same page also says hoodies are allowed but again, you can’t cover your head for security reasons.
So yeah, there may be some exceptions, but in the UK the general rule is that hats, as well as anything that covers your head such as hoods, are not allowed in casinos.
European casinos
Pretty much the same rule from what I’ve heard, as well as from what I’ve seen on their FAQ pages.
This one, for instance, lists all clothing that is not allowed and that includes headgear (it’s a casino in the Netherlands):

Out of curiosity, I also sent an email to another casino in the Czech Republic, here’s their reply:

One thing to keep in mind is that, in general, the atmosphere in European casinos tends to be a bit more formal.
Which means that hats, as well as other clothing items, may not be allowed simply because of the dress code.
If you’re not sure, always ask the casino you’d like to visit in advance.
You really don’t want to show up and be told you won’t be allowed in because you’re wearing (or not wearing) this or that, especially if you’re there on holiday and you only have so much time.
As a general rule, don’t wear anything that may be considered offensive or inappropriate, such as sportswear or flip flops, and that’ll probably be fine.
But some casinos may require formal attire, especially if you want to visit VIP rooms, so again, do check in advance if you’re not sure.
Exceptions to the rule
I’ve seen customers wear hats when playing roulette or any other casino games, even if strictly forbidden, because of an exception to the rule.
Which is, if someone actually needs to wear a hat because of an illness, injury, or any other reasons, then the casino will probably allow them.
Obviously this is quite rare and doesn’t apply to the vast majority of players.
Why are hats allowed in poker?
Whereas in games like roulette a player may randomly show up at the table and try to cheat, or steal someone’s chips, especially if the table is busy — in poker this is virtually impossible.
This is why some casinos want to make sure no one wears hats in the main casino floor (camera checks are relatively common and the players cannot wear anything that may hide their identity), but won’t enforce the rule in their poker room.
Not only that, when playing poker the dress code seems to be more relaxed, too.
For example, sportswear may not be allowed when playing slots or table games, but poker players may be an exception.
Summary
If you’re visiting a casino and you really want/need to wear a hat or anything that covers your head, check in advance because it’s not guaranteed the casino will allow it.
This is because of security reasons — the “eye in the sky” needs to see who you are, your face.
The rule doesn’t apply to poker rooms as the nature of the game, as well as seating rules, make it a lot harder for anyone to cheat in any way.