When detecting if there are any drugs in the hair of the person the testing would show what’s in the hair not on it. When you dye your hair, do any treatments, or wash it you’re not affecting the detection at all. Drugs are actually incorporated into the hair shaft from the bloodstream. Severe chemical washing and bleaching removes drugs on the hair. There may be times when it lowers the level in the hair slightly, but it will not remove the drug completely. So after doing these treatments on your hair the drugs will still be present during the testing.
Usually when the testing will take place the people will wash the hair and test the washes to make sure all the drugs are off the outside of the hair before continuing. They should assure that any drug they detect is found directly from within the hair. Dyeing the hair doesn’t affect the test results at all , since you’re just changing the color of the hair and nothing is being done to the inside of the hair.