It probably could be developed that way. But I think it leads us to a really important question: should the car prioritize the protection of its passengers, or other motorists, or pedestrians? Or minimise total number of injuries/deaths? Or prioritize the young over the old? Etc.The Tesla can't drift a little to the left (US Roadway) and take a peek at what's in front of the car ahead?
At some point, someone is going to have to write the code that does this. I could imagine that they would most likely offload the decision to the user (dropdown menus and an 'I agree' before being allowed to drive) or get an official policy from the government that might vary from country to country. Would the driver or the government be exempt from being sued for the consequences of that decision? It's a heck of a decision to take, and not something that anyone normally has to do explicitly. Could be a bit of a downer having to select who to kill before setting off on each jolly outing.