Is it natural instinct when a dog literally dies saving the owner or others?

It seems they can be more than just a friend.

I've been reading about some saving their owner or others in the family from a fire while the poor dog didn't make it out, them take bullets for us, getting in between a wild animal trying to eat us or getting us out of the way of an upcoming vehicle and them taking the full impact.

Example (the dog didn't die but got injured badly):

Is it the dog's natural instinct?

Is it natural instinct when a dog literally dies saving the owner or others?
Post Opinion