It is narrated from Sayyiduna Ali (may Allah be pleased with him) that he said: "O Messenger of Allah (peace and blessings be upon him)! What do you think, if a son is born to me after you, may I name him with your name and give him your kunyah?" He (peace and blessings be upon him) said: "Yes." So this was a special permission from the Messenger of Allah (peace and blessings be upon him) for Sayyiduna Ali (may Allah be pleased with him).
Imam Abu Dawud (may Allah have mercy on him) narrated it through Uthman bin Abi Shaybah (may Allah have mercy on him) from Abu Usamah (may Allah have mercy on him).
Also, Imam al-Tirmidhi (may Allah have mercy on him) narrated it through Muhammad bin Bashshar (may Allah have mercy on him) from Yahya bin Sa'id (may Allah have mercy on him); both of them narrate it from Fitr (may Allah have mercy on him) with the like of it. And Imam al-Tirmidhi (may Allah have mercy on him) said: "This hadith is sahih."
Related hadith on this topic