If you can remove the bolt and push the firing pin forward mechanically and see the that the firing pin protrudes PAST the face of the bolt when doing so AND the firing pin would then contact/smack the rifle breach steel in some way then I wouldn't. Possibly flatten out or wear down the firing pin face over time and start getting misfires potentially
The only gun I ever owned where this was possible was a Savage Rascal .22LR I had for my kids way back.
If its a bolt action just pull the bolt back, hold the trigger down, push the bolt forward and slowly put the handle down. Semi auto you're pretty much dry firing no matter what.
I never had thought to try pushing to see if the pin would go past on some rifles it just “looked” like there was enough travel to make contact with the breech. Of all the 22’s I have checked here so far none of them will so my above comment is wrong.