I should also note that while different breeds and sizes may get a very broad range of responses from the public (ie lots of people will assume a golden is friendly or a shepherd will defend you), it's going to be very very unusual for a criminal looking for a random target to rob, mug, jump, etc to pick anyone with any dog whatsoever. A dog is a deterrent, period. Even if they don't defend you, they're going to be in the way of an attack, or bark to attact attention, and even if they run off it means people will look for the owner - and if they find them recently attacked, they'll look for the suspect quickly. Just having a dog at all is going to seriously decrease your chances of being targeted in a random crime.
Same goes for a house or apartment. Even if they know a dog is friendly, criminals don't typically want to deal with barking or the chance the dog might slip out and be brought back by neighbors in the middle of a robbery. Houses with dogs DO get broken into, but not nearly as much as homes without.