The Quran warns believers against mocking others and using offensive nicknames.
Surah Al-Hujurat (49:11) specifically condemns ridicule, insults and derogatory forms of address.
However, nicknames based on a person's profession, positive characteristics or commonly recognized identity may be acceptable when they are not intended to humiliate or offend.
The central principle is that a name or nickname should not become a means of disrespect.