I was always taught, "when in Rome,...". Actually, my parents would insist that, when visiting both people and places, we conduct ourselves as guests, with the intent of being asked to return. This mindset has helped me be accepted in pretty much every environment I have found myself.
Yes, I am definitely speaking from a Thai point of view. Much of Bangkok is actually inhabited by Thai people.

My wife, her family, and all our friends are Thai. I haven't a single expat friend in Thailand.
Indeed, foreigners are dressing - and doing - more and more as they please. And, many Thais are becoming more resentful. The more frequent reports of the "land of
fake smiles" are testimony to it.
I think the internet has a lot to do with this change. Rather than getting advice from travel writers - people who have actually studied the destination - they now get "insights" based on gap year holiday makers and one week experts.
In the end, one will be treated as one's appearance seems to merit. How one presents themselves can make the difference between simply being serviced or being treated as a guest.
I always say,
feel free to wear an orange wig, a big red nose and slap shoes. Just don't complain if people treat you like a clown! 