HI there, welcome to the forum.
I would think so, yes. I've done this before and the more I do it the better I become at it. A lot of emotions are triggered by what you think. In Cognitive Behavioural therapy (CBT), they call this what you think is what you feel. I actually became aware of this long before I found out about CBT.
Anyway, what you need to do is simply ignore them. It's a lot easier to ignore what they have to say when you don't care about them, i.e. if they're just strangers at a party it's very easy to ignore what they have to say because you'll most likely not see them again.
Also, what they say doesn't matter. What matters is how you respond to what they say. For example, if they say you are a dumb person and you believe that then you will feel bad. If you just ignore what they say then you won't be affected by it at all.
This is what I have done for years now and it's working pretty well.