You'd need to be exposed to the chemical compounds in hair dye in extremely high doses for them to have an effect on your baby. Also, the quantities of the chemicals would need be far greater than the amount you’d use to colour your hair every month or two.
So, colouring your hair up to three to four times during pregnancy is probably safe. Plus, if you apply the dyes safely your body shouldn’t absorb many of the chemicals.
If you colour your own hair, follow the instructions carefully and apply the product for the minimum length of time stated. Also wear gloves and work in a well-ventilated room to reduce your exposure to the chemicals in the product.
You may want to highlight, paint, or frost your hair instead of dyeing it. You absorb hair colouring agents through the skin on your scalp, not through your hair shafts. So having highlights or streaks put straight onto your hair means you have less contact with chemicals.
Vegetable dyes may be a good alternative while you're pregnant. Check the packets, though. Many vegetable dyes contain some of the same chemical compounds that are used in man-made dyes. A vegetable dye that's very safe for you to use is pure henna. Henna is a semi-permanent dye that comes in a number of shades.