Yes, but airplanes cost in excess of 30 million USD. For that amount you can justify the high costs in testing, triplicate redundancy, and hiring code auditors, security auditors, every cable accounted for EM interference, etc.., etc...
You really think that your average car will have that level of redundancy and checks? Hell, the only reason airplanes have it is because it is mandated by the flight authorities. An Airbus or Boeing would not get type approval if they didn't produce certificates, and signed documents from all involved, that all the unit tests/audits were done, and passed successfully.
You really think automakers will do the same? It would drive the cost up immensly, and unless forced to, I suspect you will find most of the code will be a lousy hack-job done by the lowest bidder somewhere on the Indian subcontinent, a bit like most built-in car tech.
The only place this hasn't been the case is the ECU/EMU's. This is:
a) The only people who can do the job are competent already (very rarely can you find cheap, good, embedded programmers.)
b) the ECU/EMU controls fuel efficiency, and emissions, which the car has to pass to be allowed to be sold. Incentive to get it right
c) It is a very simple problem, relatively. Control of fuel/ignition timing, and power output/throttle control.
d) the project isn't very big (a few K of data/code).
e) It doesn't change much. It only gets refined with time (like the IC engine, which, as a concept is about 100 years old).
Also, the whole point of a driverless car is that you would be able to ignore the driving, and just go do what you want. However that level of sophistication has not even been reached in airplanes. Airplane autopilots, despite being around for decades, and generally dealing with a 3D space , in which 99% of it is air, still have software glitches/unexpected situations. That is why airlines still have highly trained people sitting at the controls at all times, paying attention and ready to make corrections if necessary.
I don't think a normal "driver" in a self driving car, will want to sit there and stare at everything around them, making sure the computer is doing the right thing. If you can't disconnect, and be a passenger, then you might as well be driving. Just as much effort, slightly higher risk of error, and you don't end up bored to death.
On the flip side, I don't think they can make a pure driverless car, just because driving is really complicated, and requires the ability to think ahead, and not just react to immediete events. Something AI is not yet able to do. You could make self-driving only roads, which area designed to not confuse the AI, and make everything work reliably. However then you've just really reinvented trains, with roads instead of rail.
The only place where I could see a self driving car working at all is on Motorways, due to their predictable, linear nature, no pedestrians and other obstacles, and clearly defined rules.