In most hotels, as long as you are decent and clean, you shouldn't have any issues.
My standard outfit is sneakers, jeans and a polo shirt, and I've spent way too much time in the bars and restaurants of 5-star hotels during the years I lived in London, so I would know if it was an issue. In some cases you may yourself feel slightly out of place because many other people are dressed more smartly than you, but that's about it. Sometimes one bar or restaurant in the hotel may have a stricter dress code, or there may be specific recurring events where something specific may be required or expected, but this will usually be made quite clear, and limited in scope.
Believe it or not, I know restaurants in Hawaii with stricter dress codes than nearly any place I've been to in London.
Note however that flip-flops, shorts, and a sleeveless t-shirt may be over the line, though I never tried that so I can't really say.
There is one exception I know of, though (there may be others): the Ritz. Don't remember if it was a no-sneakers or no-jeans rule, but they didn't want my business. Too bad for them, the Dorchester got my money :-)
Just for reference, private member's clubs are a very different story, but you would need to be invited, and whoever invites you will usually make the rules clear to you.