A very interesting book that touches many times on the subject is Polar Dream by Helen Thayer.
The short version is that her dog saved her life several times fending off polar bears.
BUT it was a husky that had a natural instinct to cope with the situation.
(IE not a pet, it was an Innuit working dog used to polar bears)
The interesting part is how very differently the dog behaved with different bears.