There can be an immutable smart contract which is in compliance with the law (though you have to be more specific with which law, but for these purposes I know we mean US law).
Point being, immutability is not sufficient to demonstrate that a contract is in conflict with the law.