There is nothing wrong with going to the dentist to have the teeth cleaned and whitened; this is not regarded as changing the creation of Allah, because the aim is to remove yellowness from the teeth and restore them to their natural cleanness and whiteness.
The Messenger (blessings and peace of Allah be upon him) encouraged using the siwaak, to purify and clean the mouth. He (blessings and peace of Allah be upon him) said: “The siwaak is purifying to the mouth and pleasing to the Lord.” Narrated by al-Nasaa’i (5); classed as saheeh by al-Albaani in Saheeh al-Nasaa’i.
Shaykh al-Islam Ibn Taymyah (may Allah have mercy on him) said, speaking of the places in which the recommendation to use the siwaak is emphasised:
When the taste or smell in the mouth changes or the teeth become yellow or…, because of the report narrated by Tameem ibn al-‘Abbaas who said: They came to the Prophet (blessings and peace of Allah be upon him) and he said: “Why do I see you coming to me with yellow teeth? Use the siwaak.” Narrated by Ahmad. End quote.
Sharh al-‘Umdah, 1/217-218
Ibn al-Atheer (may Allah have mercy on him) said in al-Nihaayah (4/153):
Yellowness of the teeth refers to the yellow colour of the teeth and dirt that gets onto them. This hadeeth encourages use of the siwaak. End quote.
See: Nawaadir al-Usool, 1/186; al-Faa’iq fi Ghareeb al-Hadeeth, 3/220
This hadeeth was classed as da‘eef (weak) in Silsilah al-Ahaadeeth al-Da‘eefah (1748), but there are corroborating reports in the hadeeths which indicate that it is prescribed to use the siwaak in order to clean the mouth, such as the hadeeth of ‘Aa’ishah quoted above.
Al-Nawawi (may Allah have mercy on him) said:
The hadeeth of Tameem ibn al-‘Abbaas is da‘eef, but there is no need for it as we have the evidence in the hadeeth, “The siwaak is purifying to the mouth.”
End quote. Al-Majmoo‘, 1/325.
Then al-Nawawi (1/328) mentioned that one of the cases in which it is confirmed that it is mustahabb to use the siwaak is if the teeth look yellow.
Based on this, there is nothing wrong with going to the dentist to have the teeth whitened and to remove the yellowish colour from them.
And Allah knows best.