No, making cars was never outright illegal. Operating a cap company, (or rather an illegal one), without proper licensing was. Operating a hotel out of your house was. Nice strawman.
Ford Motor Co produced cars without such a license and eventually a case went to court. Ford initially lost but then the ruling was overturned.