If it's acceptable for a person, in the heat of the moment, to decide to save themselves at a cost to others (once they've considered what other options are available to the best of their ability), then it's acceptable to decide to put in place a system that does the same, assuming it is (at least) comparably capable of considering other options.
If it's heroic for a person to, in the heat of the moment, decide that it's important to save another person even at risk to themselves, then it's also heroic for them to put in place a system that does the same.
Of course, opting out of the whole thing and sticking with a human-driven car is also a choice, and once autonomous cars are sufficiently better than human drivers it may itself become an unacceptable choice.
In the long run, the law should probably catch up to wherever we've arrived at socially and forbid more egregiously unacceptable choices, but I don't see any reason we should start there.
What's acceptable or not will be decided in a court, unfortunately. And like most other traffic-related issues, some default rule (driver in rear at fault etc) will be built over many cases over time.
Unfortunately its unlikely a reasonable rule will prevail. Instead some enforceable rule will win out. Regardless, early manufacturers of autonomous cars are likely to be sued to oblivion in the process.
Autonomous car algorithms must face this issue immediately. Choosing to serve the driver/owner's interest will be a compelling sales point.