No, not really. Exhaust cutouts can be illegal, specifically when they dump out ahead of your emissions devices - basically your catalytic converters.
If a variable exhaust system was illegal, Ford would be in trouble. Some of the highest end Mustangs have been coming with a stock setup that switches from a fairly modest sound to almost race ready. (There was a video that showed this nicely, but heck if I can find it right now.)