All perfect praise be to Allah, The Lord of the worlds. I testify that there is none worthy of worship except Allah and that Muhammad is His slave and Messenger.
It is not permissible for a person to supplicate for the forgiveness of his parents if they died as disbelievers.
Allah says (what means): {It is not for the Prophet and those who have believed to ask forgiveness for the polytheists, even if they were relatives, after it has become clear to them that they are companions of Hellfire.} [Quran 9:113]
However, it appears to us that there is nothing that prevents a person whose parents are disbelievers from saying in the Tashahhud or in any other context, “My Lord, forgive me and my parents and the believers on the Day of Judgement,” while intending Adam and Eve, may Allah be pleased with them, by ‘parents’ as this intention restricts the apparent meaning of the expression, and there is no sin on him because he excluded his disbeliever parents with this intention. It is known according to the scholars of the Principles of Fiqh that the intention specifies the general statement.
Anwaar Al-Burooq, which was authored by Al-Qaraafi, reads, “Specifying general statements, such as one saying, ‘I swear by Allah, I will not wear any garment’ while intending to exclude flax (linen) from his oath; this generality is specified by this intention, and he does not break his oath if he wears flax because he did not include it in his intention.”
According to some scholars, this supplication that you say at the end of the Tashahhud is recommended.
Al-Fataawa al-Hindyyah (The Indian Fataawa - a Hanafi book of Fiqh) reads, “It is recommended for the praying person to say after the salutation on the Prophet at the end of the prayer, ‘My Lord, make me an establisher of the prayer, and [many] from my descendants, our Lord, and accept my supplication. Our Lord, forgive me and my parents and the believers the Day the account is established.’ This is stated in At-Tataarkhaaniyyah quoting Al-Hujjah.”
For more benefit, please refer to fatwa 90553.
Allah knows best.