I think the legal or illegal issue has to deal with the decibals...for example this is the California Exhaust Mod Law:
27151. Modification of Exhaust Systems
No person shall modify the exhaust system of a motor vehicle in a manner which will amplify or increase the noise emitted by the motor of such vehicle so that the vehicle is not in compliance with the provisions of Section 27150 or exceeds the noise limits established for the type of vehicle in Article 2.5 (commencing with Section 27200) of this chapter. No person shall operate a motor vehicle with an exhaust system so modified.
27152. Exhaust Pipes
The exhaust gases from a motor vehicle shall not be directed to the side of the vehicle between 2 feet and 11 feet above the ground.
27153. Exhaust Products
No motor vehicle shall be operated in a manner resulting in the escape of excessive smoke, flame, gas, oil, or fuel residue. The provisions of this section apply to motor vehicles of the United States or its agencies, to the extent authorized by federal law.
23130. Vehicular Noise Limits
(a) No person shall operate either a motor vehicle or combination of vehicles of a type subject to registration at any time or under any condition of grade, load, acceleration, or deceleration in such a manner as to exceed the following noise limit for the category of motor vehicle within the speed limits specified in this section:
Speed limit
of 35 mph
or less
Speed limit
of more than
35 mph
(1)Any motor vehicle with a manufacturer's gross vehicle weight rating of more than 10,000 pounds and any combination of vehicles towed by such a motor vehicle. 86 dbA 90 dbA
Speed limit
of 45 mph
or less
Speed limit
of more than
45 mph
(2)Any motorcycle other than a motor-driven cycle. 82 dbA 86 dbA
(3) Any other motor vehicle and any combination of vehicles towed by such motor vehicle. 76 dbA 82 dbA
(b) The noise limits established by this section shall be based on a distance of 50 feet from the center of the lane of travel within the speed limit specified in this section. The Department of the California Highway Patrol may provide for measuring at distances other than 50 feet from the center of the lane of travel. In such a case, the measurement shall be corrected so as to provide for measurements equivalent to the noise limit established by this section measured at 50 feet.
(c) The department shall adopt regulations establishing the test procedures and instrumentation to be utilized. These procedures shall allow, to the extent feasible, noise measurement and enforcement action to be accomplished in reasonably confined areas such as residential areas of urban cities.
(d) This section applies to the total noise from a vehicle or combination of vehicles and shall not be construed as limiting or precluding the enforcement of any other provisions of this code relating to motor vehicle exhaust noise.
(e) For the purpose of this section, a motor truck, truck tractor, or bus that is not equipped with an identification plate or marking bearing the manufacturer's name and manufacturer's gross vehicle weight rating shall be considered as having a manufacturer's gross vehicle weight rating of more than 10,000 pounds if the unladen weight is more than 5,000 pounds.
(f) No person shall have a cause of action relating to the provisions of this section against a manufacturer of a vehicle or a component part thereof on a theory based upon breach of express or implied warranty unless it is alleged and proved that such manufacturer did not comply with noise limit standards of the Vehicle Code applicable to manufacturers and in effect at the time such vehicle or component part was first sold for purposes other than resale.
23130.5. Vehicular Noise Limits: 35 MPH or Less Speed Zone
(a) Notwithstanding the provisions of subdivision (a) of Section 23130, the noise limits, within a speed zone of 35 miles per hour or less on level streets, or streets with a grade not exceeding plus or minus 1 percent, for the following categories of motor vehicles, or combinations of vehicles, which are subject to registration, shall be:
(1) Any motor vehicle with a manufacturer's gross vehicle
weight rating of 6,000 pounds or more and any combination
of vehicles towed by such motor vehicle ........................................... 82 dbA
(2) Any motorcycle other than a motor-driven cycle ......................... 77 dbA
(3) Any other motor vehicle and any combination of vehicles
towed by such motor vehicle ........................................................... 74 dbA
No person shall operate such a motor vehicle or combination of vehicles in such a manner as to exceed the noise limits specified in this section. The provisions of subdivisions (c), (d), (e), and (f) of Section 23130 shall apply to this section.
(b) Measurements shall not be made within 200 feet of any intersection controlled by an official traffic control device, or within 200 feet of the beginning or end of any grade in excess of plus or minus 1 percent. Measurements shall be made when it is reasonable to assume that the vehicle flow is at a constant rate of speed, and measurement shall not be made under congested traffic conditions which require noticeable acceleration or deceleration.
(c) Test procedures and instrumentation to be utilized shall be in accordance with regulations of the Department of the California Highway Patrol, except that measurement shall not be conducted within 200 feet of any intersection controlled by an official traffic control device, or within 200 feet of the beginning or end of a grade.
(d) The noise limits established by this section shall be based on a distance of 50 feet from the center of the lane of travel within the speed limit specified in this section. The Department of the California Highway Patrol may provide for measuring at distances closer than 50 feet from the center of the lane of travel. In such a case, the measuring devices shall be so calibrated as to provide for measurements equivalent to the noise limit established by this section measured at 50 feet.