No you can't. Was there ever a law explicitly saying coding an OS was illegal? Versus operating a cab company without registering with the government to prove compliance with laws already in place to deal with those? Or similarly running an illegal hotel out of your house?