What is the condition of dying the hair in Islam? Is it right to dye the hair when you are dirty and take major ablution (Ghusl) later?
There is no proscriptive law in the Islam that prohibits dying/coloring the hair. There are some narrations which may tell coloring the hair in black makes it makruh for men; but there is not any information about women’s hair and there is no limit about the color.
Also, the hair dye does not prevent anyone to take the ritual body ablution(ghusl). There is a hadith like this: Jaber(excellency) explained: “During the conquest day, Abi Quhafa was brought near the Messenger. His hair was as white as snow. He (the Messenger of Allah) said: Take him to one of his woman (for his hair and beard color) to change. But avoid dying it to black.” (Muslim-Kitab Al-Libas 79; Al-Nasa’i-Zinat 15).
The important point here is, women must avoid exposing the hair to foreign men, because covering the hair is a definite order/command of Allah, the Almighty.