I have come across the following the sentence : (I ripped my shirt on a nail )

Can I just say " The nail ripped my shirt " instead .


As a sentence standing alone, it would imply that the nail had attacked your shirt on its own.

You could use it as part of a longer narrative. There was a nail sticking out of the fence. When he pushed me, I fell against the fence and the nail ripped my shirt.