The normal dye of hair found in markets is a color that has no mass to it. therefore, it doesn’t affect the washing of the hair in major purity such as Ghusul.
If it does have mass and it forms an external layer that is felt, in this case, it is not permissible to use.