Is it ok to dye your hair if you use a cap?

Sam • 🇬🇧 UK Full Time Mum, 2YO girl, pregnant with 2nd
I usually have highlights using foil wraps but to avoid getting any dye near my scalp I've booked in for cap highlights next week. (I'll be 6 1/2 weeks) Is it safe? Or is it best to avoid hair dye altogether in the first trimester?