This is really a case by case and it depends on the intentions of the person/the language you are learning. If the person actually meant what they say and it was a verbal attack, then no, that's not okay.
But what we don't know (because we are not fluent in the language) is that there is slang in every language and "offensive" words to us might have a different meaning in that language. For example, we have words in Cantonese slang that literally mean "stupid" or "naive". But when used in slang, it means "clumsy" -- which is not derogatory. The word itself in the dictionary still has the meaning "stupid", but when used in context, it means something else.
So yeah... it really depends on the person who's saying it.