To clarify, rare candies don't take EVs into account when it raises your stats. Essentially, you will want to finish EV-training before using rare candies (or not use rare candies at all until the highest of levels, which would be the best time for it anyway). But if you do use rare candies before you finish EV-training, the EVs will come in effect the next time you level up normally, so if you really choose to use candies, just leave some room to actually level up normally at some point.