Maybe you're talking about moral relativism, which can be a meta-ethical position (what's right or wrong depends on the context) as well as a normative theory.
Are you thinking of a situation where, for example, the bank robbers think it's okay to pull heists, but they concede that it's okay for the police to try to stop heists? And that they would do the same thing if they were police? Kind of like in Heat? Such a great movie.
Yeah, sort of. That's basically the case for which faction membership is not in question and is not mutable.
The only time I've really heard it formalized is in Plato's Republic where one of the naive interlocutors suggests that morality consists of "doing good to one's friends and harm to one's enemies".
If it's worth saying, but not worth its own post (even in Discussion), then it goes here.