This being audio there are numerous ways to get the result you want, and this being the internet there are plenty of opinions that are quoted as fact or absolutes
So here is my opinion only and method
These are what I think about before using compression when recording
1) What am I recording and is compression appropriate?
If I were recording a fantastic opera singer then huge dynamic range would be appropriate and the singer would probably have fantastic vocal control. Pristine uncolored audio is likely the desired outcome so compression is probably not needed (although a limiter or a lot of recording headroom might be as opera singers can get really loud)
Back to reality. I'm usually recording myself or local bands doing rock/pop type stuff and we tend to have poor vocal chops Especially me. Dynamic range is all over the place and for the finished product is likely to need vocals with a fairly narrow dynamic range. Putting a compressor to a least give the vocal a little hug if not an outright squeeze is going to help get things under control a little. As a plus when hearing themselves with some compression in the cans, many singers, I find, step up the performance a little as they like what they hear
2) Can I set the compressor to get what I want
Yes, Yes I can
3) If I'm going to use this hardware compressor anyway and I know how to set it, Is there any reason not to use it on the way in pre conversion.
Many will tell you that there is no noticeable difference between a track that you record with compression and one you send out for an additional round trip through the converters. This is probably true but then as I already mentioned Singers often give you a better result when they hear themselves compressed so the result isn't the same. Also why re convert the audio if you don't have to
Many will also say that compressing on the way in limits your options later. This is true but so what. I could set up a headphone mix in the cans with compression for the vocalist to hear and record a dry signal which I then send out to the compressor later to get the compression I already got but didn't record first time around. What a workflow killer. I'm recording pop/rock, I'm going to need compression, I know how to get it on the way in, Why not record it.
4) light compression on the way in plus a little track compression in the mix often sounds better (to me)
Plug in compressors IMO sound better when they are not working too hard. If I can get 3-5dB of compression from hardware on the way in and then another 3dB of compression during the mix the result sounds more pleasing to me than slamming a compressor hard once. Especially a plug in compressor which seems to get artifacty and less pleasing when pushed hard (say beyond 5-6dB of gain reduction)
5) I like the sound of my hardware compressors do I have anything in software that sounds the same
No. I have yet to find a plugin that sounds the same as the sound of my hardware comps. Can I get a good result with the software? Sure. But why spend time trying to get close to the sound I want after recording when I can just drop the compressor I like into the recording chain and get the exact sound I am expecting and want
This is just one opinion and it works for me but as always YMMV