Iran was/is Russian ally. Very prominent part of Russia is Chechnya. It is islamic and its leader is effectively Putins favorite pet. It is not as bad as Iran in treatment of women, but it is also not like Russia would care one bit about that.
Russians and Chineses and anyone really absolutely care about who they form alliances with.
Not sure where you get the idea that people don't care who they are friend with. They absolutely don't want to be friend whose culture is considered as disgusting.
They may form an alliance due to having a common enemy but in practice the alliance is just checking a box.