Swerving is not legal and it's not legal because you might hit something you can't see. On the other hand, an autonomous vehicle maintains perpetual 360° situational awareness so it already knows whether it's safe to swerve.
If I'm driving down the road and someone pushes a kid in front of my car, I'm very likely to swerve, even if I'm not 100% sure if there is someone next to me. If I hit a car next to me and cause damage/injure people, there is a good chance that a jury would find in my favor because a "reasonable person" (the relevant legal standard in a civil case) would seek to avoid the certain death of a faultless child, even if it means a chance of injury to passengers in a vehicle that might be nearby. I wouldn't swerve if I thought a bicyclist were there, but I would likely swerve into a vehicle, which affords occupants significant protection.
And I certainly would not be found guilty of a crime ("beyond a reasonable doubt", the standard in a criminal trial) because it is not criminally negligent to swerve when faced with the certainty of killing a child. Under the "defense of self/others" doctrine, you can do many things that would normally be illegal, if you are doing them to prevent the imminent death of yourself or someone else. (These analyses are not super detailed, but IAAL.)
The thing is... Neither are people. A kid darts out on front of you and you won't have time to make a conscious decision. The maneuver you make will be too fast for rational thought, and your brain will explain to itself why it did that later.
... Incidentally, this is one of the things that scares me about human drivers. Put a human on the stand to testify and most will say they never saw that kid, no matter what physical process happened to their eyes and neurons. I think most even actually believe it.
In any case, I'm glad that in this incident they'll be able to do a full NHTSA workup, pull logs, and reprogram the machine to avoid an accident like this in the future. Can't do that to a human driver.
(Also in Oz, rolling your car when you try to swerve to avoid a kangaroo is so common that you're normally taught to just break instead)
They don't, but: 1. Your perception is not perfect. 2. A truck passing you means there was a blind spot and you have no idea what was there. 3. There are areas with many lanes merging / splitting, where it takes most of your attention to know where you're going; little left to track everything around.
Tracking your surrounding is great. Accepting that you're going to make mistakes, adjusting for that and also allowing assistive tech is even better.
Also, if something potentially dangerous/important is happening to your left, you will focus your attention there and not be aware of things happening to your right, even if you normally would have seen those things had you been looking straight ahead.
I try to know what is going on around me, for the reason you describe (exit strategies), but I'm aware that sometimes I simply do not know what is to my left — and would not want to swerve there.
Having seen friends driving Teslas, I can see how the surround-view could be useful for situations like this. However, I have also seen that cars appear/vanish for no reason, and it is clearly not reliable at this point.