For it to be racism, it needs one thing which is intent.
Therfore it is always bad, besides the intent is to make a joke, where it can be ok if, one of the "joked upon" group is present and representing the group, is okay with it.
In a discussion, one should avoid to try to disproove an argument by calling it racisst in my oppinion, if its possible, because thats a very emotionaly charged response, which can be assumed to be a cheapshot for the winning.