I think that is one of the main arguments with self driving vehicles. If the vehicle can make a decision, that might result in the death of another, Who do you sacrifice? The Driver, a pedestrian, or another vehicle.
In theory, the other vehicle is impact resistant, more so than a Tree or pedestrian.
Tough nut to crack.