Perhaps they would, but I would guess that you would still get scared when hearing the warning instead of the shock it self.
For example if you would get stabbed 15 seconds after hearing a beep I think you would develop pavlovian like response to the beep itself.