All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger.
Calling people with offensive nicknames, which means to call a person with a name that he hates, is not permissible. Allaah Says (what means): {…and do not call each other by [offensive] nicknames. Wretched is the name of disobedience after [one’s] faith. And whoever does not repent — then it is those who are the wrongdoers.} [Quran 49:11]
However, if a person does not hate to be called by a given nickname, then this is not included in calling each other with offensive names which the verse mentioned dispraised its doer. It is on this basis that some scholars interpreted the narration which you mentioned in the question, i.e. the narration about the man who used to be called Himaar (i.e. donkey) and this narration is reported by Al-Bukhari .
As regards the narration ‘‘An old woman will not enter Paradise.’’ it is reported by At-Tabaraani and it is authentic. This narration included a kind of permissible joking which included saying the truth.
This narration is an indication of the complete moral conduct which the Prophet had and his friendliness with the companions .
Allaah Knows best.