Obviously this doesn't allow you get around laws such as warranties but I don't see why it can't be used if everyone agrees to it.
If you sign a contract to abide by a smart contract that was designed in bad faith or misrepresented I fail to see how that's any different.
Even valid contracts are bound by the law. E.G. you can't sell yourself into slavery. Similarly, a smart contract can be a tool to execute the terms of a legal contract, but if it behaves in a way that would be illegal under a traditional contract I doubt any court in the US or Europe is going to recognize that as legal.
I admit enforcement is another issue entirely though.
Fraud, for example, isn't legal even if you have a cleverly crafted contract that uses wording tricks to technically be true.
I would expect a court to take a dim view of a smart contract that has an obfuscated, non-obvious mechanism for someone to siphon off all the money in an undisclosed fashion. "Code is law", but so's "you can't defraud people".
You are begging the question by presupposing that for every smart contract there could be a possible legal contract that can bind the people who sign it to the results of the smart contract.
If a smart contract is illegal, then any written contract that binds people to the results of that contract would be similarly illegal.
For one, as a general concept the parties to the contract need to actually understand the terms and courts will somewhat regularly throw a contract out if they think there were implications that were not apparent to one of the parties. Smart contracts seem like absolute minefields for this kind of problem.
If your mechanic installs the tires in the passenger cabin, no one cares about the mechanics' lien. Depending on the judge they might not even care about the fine print on the back of the invoice, because installing tires in the passenger compartment is that dumb.