In English, there is no spec for different levels of formality. There is no universally documented way to being less courteous to bosses and policemen. Saying "sup dude" or "how's it going" is part of the American standard library, not the language.
And to your point directly, "nigga" is incredibly informal and casual, and would never be something anyone (much less a non-native speaker) should ever use unless they know what they are doing. And usually, they should be black, too.