Gear Compatibility: Can You Use an 18-Speed Cassette on a 21-Speed Bike?
No, you cannot use an 18 gear back wheel on a 21 gear bike. The number of gears on a wheel is determined by the number of cogs on the cassette. A 21 gear bike will have a cassette with 21 cogs, while an 18 gear bike will have a cassette with 18 cogs. The chain on a 21 gear bike will also be longer than the chain on an 18 gear bike, so it will not be able to reach all of the cogs on the 18 gear cassette.
50cc Dirt Bikes and Road Use: Legality and Restrictions
Blue Lights on Bicycles: Legality by State & Visibility Rules