When I dye my hair in the bathtub I apply a thin layer of petroleum jelly to the tub.
The thin layer of petroleum jelly will make the hair dye clean up easier when the hair dye gets on the petroleum jelly it will just wipe right up with the petroleum jelly without staining the tub.
Just put a thin layer of petroleum jelly on the bottom of the tub and then do your hair dye as normal.
If you do get some hair die in the tub you can usually easily clean it up using some finger nail polish remover that is acetone based.
The acetone based nail polish remover will usually help remove the hair die which has happened to me.
I've gotten the hair die out of my bathtub using the acetone based nail polish remover.