There's a colloquial saying in Tamil that I am used to,
If you throw stones at sewage, it's your dress that will get spoiled"
It means if you try to change the opinion/behavior of a stupid/adamant person by offering them some good advice, only your reputation will be lowered because they won't be willing to listen to you. Apart from not paying heed, they would probably name-call or badmouth you in front of others causing embarrassment to you.
Just to give you some context on how this is used, let's say you spot a school going kid smoking cigarettes. You politely walk up to him and advise that smoking is dangerous to health and environment. But he is too arrogant and starts loudly abusing you in public.
That is, trying to help a person who is not willing to listen will only prove to be detrimental for your own good.
I found "You can lead horse to the water"TFD very close but I feel it doesn't convey the repercussions(sewage spoiling the dress).
Also, to shoot oneself in their foot seems equivalent but I think it is applicable to scenarios where you planned to harm the other person but ended up getting harmed. In my scenario, you approach someone with good intentions but end up abused.
Are there any other phrases that I can consider?
A possible duplicate has been raised citing Are there any English idioms to describe “futile benevolence?”
I am not sure about the other question but I should clarify that in my context, the person knows that their actions (benevolent or otherwise) could potentially backfire. Yet they decide to go ahead and confront. The original saying has a slightly humorous or warning undertones to it.
A: Oh my God! Look at those ignorant folks raising slogans against Vaccination...I will go and explain them about all the Vaccination benefits.
B: I suggest not. If you throw stones at sewage (attempt to correct things), it will only spoil your dress (causing harm/embarrassment/ill repute etc.)
Hope this clarifies.