Massaging your hair with oil is definitely needed but adding half-a-spoon of lemon juice could actually prevent toxic and dyes to damage your hairs.
Best would be to avoid direct contact of skin or hair to such colours, for this you can easily wrap a bandana around your head.