It is perfectly safe to hook any code as long as you can guarantee no thread is currently executing the instructions you're replacing.
Safety means more than torn writes