Most dash cams have a vibration/motion sensor that locks the recording when it senses something.
You just have to mount it somewhere where it won't be seen/stolen