Can the doctor still save someone else if killed?
There are many variants of this game, and I can't find any place where rules state it (oficially) but there's no order when character's skills are played at night.
Doctor will save its target even if he's targetet by the werewolves/vigilante.

You don't need to look for a logical way of how does it happens, as it's not logical either a doctor healing someone from a werewolf attack (how is he supposed to heal someone ripped off?).

The only way of negating effects is with skills which state they negate the effect (some variations of the game include the escort, who stops someone from using his action that night).

Edit: in the scenario you proposed doctor would die but save the victim of the werewolf. Vigilante would die of guilt next day.