Poster, it sounds a very difficult situation for you, to be sure.
A couple of points I wanted to make have been raised by others:
-dementia always trumps logic
-you cannot change her behaviour, only your reaction to it
These have been very difficult lessons for me to learn in my interactions with my mother, who has Alzheimer's-type dementia (possibly with vascular involvement but I'm waiting for a diagnosis on that). When you add to the mix that my mother and I have never been close, and she has always been "difficult" to be with, well, I am sure many here know what I mean about that. My mother is also very good about "editing" stories about the past and it drives me mad and/or upsets me an awful lot. I used to think she was leaving things out on purpose but now I just chalk it up to the dementia and try to pay as little attention as possible. Much easier said than done, however.
Of course you don't want to be rude to your mother. I get that. If you will indulge me, let me tell you a story about my beloved auntie and her mother, my paternal grandmother. When that grandmother first went into a nursing home (for mostly medical issues), my auntie would visit her every day, sometimes more than once a day, despite having a baby and young child at home. My grandmother was often rude, nasty, and just plain mean to my aunt. She was also non-compliant with medical orders and her doctors, but that's another story. My aunt finally got tired of being treated like this, and one day said to my grandmother, in a very kind and calm tone of voice, "Mom, I can tell you're not feeling well today and are not up for having visitors. I will come and see you tomorrow and maybe you will feel better and more like having company", and then left. When my aunt returned the following day, my grandmother was happy to see her and they had a pleasant visit.
This is not being rude, it is setting limits, refusing to be treated poorly, and using behavioural conditioning. Of course it's different dealing with someone with dementia, but the basic idea remains the same.
You could politely ask your mother to change the subject. You might say, "Mother, I don't want to discuss my hairstyle right now."
Or perhaps you could break the loop in another way. Is there someone who could visit with you? (I don't visit my mother alone, ever, because she starts on her "you kidnapped me and put me here and stole all my money and you're a terrible person and I hate you" routine and I don't want to hear that. So I am never alone with her, full stop.)
Perhaps you could confine your visits to a public area; my mother behaves better with other people around (see above).
Another tactic I use with my mother, when she starts on a subject I don't want to hear, is to excuse myself to use the toilet. I use the public ones in the care home, not hers. If I'm very upset, I take an extra couple of minutes and text a friend for support, do some deep breathing, et cetera. Some visits, I go to the toilet an awful lot!
I realise you may have tried all these ideas and more, and not found anything helpful. It's just what I was able to think of. I hope others have some helpful suggestions/insight for you.
Setting limits to protect yourself, is not the same as being mean or abusive or even rude. You are an important person, too, and you should wear your hair however you like, and it's not fair you have to get all this grief from your mother. I'm sorry.