I would never use heavy compression when recording.
Sometimes I use light compression from a hardware channel strips when recording. Sometimes I record with no compression.
The purcpose of compression when recording is just to ensure that you have a fairly consistent recording—not to limit the dynamic range as much as you would when making the final product.
I would say that if you have any doubt, don't use it.
Somre free advice, if you want it:
Where many new engineers go wrong is failing to pad the mic sufficiently. It is easy to get breakup at the mic level, no matter where you set the input (trim) or how much you compress. If you hear distortion but don't see any meters in the red, make sure you are not over-blowing the microphone. Some mics have a switch on the body (for example, 0, -5, -10). If you can't pad the mic, you may need to change mics. I have an RE20 (dynamic mic) specifically for singers who can't control the volume/distance when singing. It is much harder ot distort a dynamic mic than a condenser.