Cars don't just operates on roads, private roads, tracks, etc also exist. As a result, manufactures/sellers can sell them because they are not "intended" for road use. Also the reason they are technically illegal is to give law enforcement a legal reason to be able to mess with you should they be suspicious of something else, since they need a reason to initiate interaction with you.
EDIT: aimed at aftemarket products
EDIT: aimed at aftemarket products