There's a best time and a best procedure for just about everything, even for dyeing your hair. It's tempting to think it's a good idea to wash your hair just before applying dye – after all won't clean hair take up the colour better? In fact, it's more complicated than that.
Washing your hair also cleans the scalp, and in doing so weakens the protective hydrolipid film. This is a fine barrier layer of sebum and sweat that covers the skin and coats it with a water and oil emulsion, helping to maintain a healthy pH and defending against bacteria and fungal infections.
In simple terms, a recently-washed scalp is more vulnerable. And, since hair colour products are aggressive, dyeing recently-washed hair can result in skin irritation.