Yes you can use purple shampoo on black dyed hair or any other colored hair as purple shampoo does not change your hair color so it will not remove your dyed hair.
So if you have black dyed hair and want to keep the black dyed hair you can safely use the purple shampoo as it will not change your hair color even when dyed black or any other color.
You can use purple shampoo in black or silver died hair to help get rid of any yellow or brassy undertones and make your hair look much better.
You should keep the purple shampoo in your hair for around 5 to 6 minutes to allow the purple shampoo to work properly and then rinse it out of your hair.