IMO, color grading is the last step, but sometimes you need to do both, so before and after. I can’t say if that will work with every case, but the fact is, sometimes you get footage that unfortunately was not shot optimally.
I can remember a specific case where we had no choice but to adjust the color in order to get a better key. And on top of that, the method we ended up using was quite complex, where we only used the result as a matte, etc. etc. etc… which gave us slightly more options than you can achieve using the standard method. Then when we were happy with the result, we tweaked the colors again to better match the footage we were keying on top of.
So, to conclude, you cannot really color grade the footage before the key, because changes to that footage, will likely affect your key result
1. adjust color if necessary
2. key
3. color grade