There's an idiom in English for a person who criticises others but when someone else criticises them, they don't like it.
Definition from Cambridge English dictionary:
Someone can dish it out but he or she can’t take it: someone easily criticizes other people but does not like it when other people criticize him or her.
Example: He’s mad at me for teasing him – he can dish it out, but he can’t take it!
We also use don't dish (out) what you can't take to tell someone that they're criticising others but when someone else criticises them, they're easily offended.
Does Spanish have the same idiom? Or what would be the closest idiom to that?