Some of our detergents contain enzymes which are naturally derived molecules. Generally, we use different enzymes such proteases which break down proteins and amylase which breaks down starch and then finally, another major ingredient that we use, like most other detergent manufacturers is bleach. The bleach turns the stain into more soluble colourless particles that can be easily removed and carried away into the wash water. So, in actual fact, it can remove bleachable dye stains. So, to kind of answer the other part of the question, laundry detergents can remove certain dyes, as well as stains.
Most dyes are composed of molecules that these ingredients can’t target. Surfactants can't globuralize the dyes, nor can enzymes gobble them up, unless they're vegetable-based. But bleach can effect dyes and this is why, washing powders designed for colored clothes don’t contain any bleach.