Yeah, can be a problem. I had some Chinese rugs in recently and they were covered in stains like tea/coffee/wine etc. The spills covered areas that included both the light cream colours and the darker blues. Got the stains out of the cream colours a piece of cake but it started taking the dye from the darker parts, so had to bail out quick!
It all depends on the fastness of the carpet dye. Bleaching works on the principal of last in, first out, so your bleaching has to be controlled enough to be just enough to get the stain out without going any further. Sometimes the stain is less removable than the carpet dye, in which case game over.