"Set off" vs "Go off"

Hi there

I would like to know if I can use these phrasal verbs interchangeably when I talk about an alarm.

E.g. ‘The alarm set off/went off when the burglar broke the window.’

Thanks in advance!

‘The alarm went off when the burglar broke the window.’

" When the burglar broke the window, it set off the alarm."