Because the term is considered extremely offensive, it is often referred to by the euphemism "the N-word". But it remains in use...by African Americans among themselves.
Indirect link to avoid using the actual word here:
https://en.wikipedia.org/wiki/N-word
Obviously the degree of offensiveness is vastly different, but there have often been words that would be offensive when used by an outsider but accepted within a group.
If a straight called me a hippie or a freak, it might be an insult. But if another freak - or even even one of my straight friends who was cool - called me a freak, I would take it as a compliment.
(See my other comment for an explanation of the terminology.)
Another example from my childhood: I grew up in an Italian family, and back then you would never want to call an Italian a "wop" or "dago" to their face. In fact you would still be wise to avoid those words.
But my cousins from the Italian side of the family? They called each other "wop" and "dago" all the time! Just normal sibling kidding around.