You always should do Vfx work before any color work is done.
If the footage is in a log format, put it in a linear space before keying. I recommend using the free Open Color IO plugin. Then covert back to log after the comp is done for export. You can also use the Color Profile Converter effect, but double check to make sure you are not losing color info in the round trip.
Couple side tips – make sure you are working in 16 bits if you have footage higher than 8 bit (if you’re working in log, it’s likely at least 10bits). Work in 32 if you need it, but be warned that many effects do not work properly at that depth. I also recommend de-noising the plate before pulling a key.