Nothing against dogs, but dogs can’t stop bullets. And if the intruder has appropriate clothing, even if the dog attacks him, if he’s got a knife, the dog is not going to make it.
It will alert you that someone is on the premises, but you could lose your beloved in the process. We bond w/our pets. Also, the bigger the dog, the more expensive. Nowadays, that is also something to consider.