No, it is not necessary to wash your hair before dyeing it, on the contrary! You apply the dye to dry, unwashed hair. It is in any case better not to wash your hair too often, but do not wash it two days (48 hours) before you dye it. There will then be more natural oils and sebum on your scalp that will better protect your scalp during the dyeing process and lets the hair dye penetrate better.