Apparently only when the applicable statute itself specifies that violations of the regulation is a crime. That's a recent ruling out of the 9th Circuit U.S. Court of Appeals in a case dealing with the importation and sale of R-12 freon, an ozone-depleting substance regulated under the federal Clean Air Act (CAA) (U.S. v. Alghazouli).
The defendant was convicted on five counts arising out of the importation of R-12 freon. Three of the counts charge him with violating 18 USC 545, which prohibits fraudulent or knowing importation of merchandise "contrary to law." Another count charged him with violating the CAA based on his knowingly violating a regulation prohibiting the sale of R-12 freon to an improperly certified person.
The defendant claimed, in part, that the term "law" in the phrase "contrary to law" does not include a regulation and that even though a knowing violation of the regulation at issue is criminal, he did not knowingly violate the regulation.
The court held that Congress intended the term "law" in 18 USC 545 to include a regulation when, but only when, a statute specifies that a violation of an applicable regulation constitutes a crime. Since the CAA specifies that a violation of 40 CFR 82.4 is a crime, the defendant's conviction for selling R-12 freon to an uncertified person is valid.
The court also held that the government only had to prove that the defendant had knowledge of the facts that constitute the offense, not that he knew that his acts were unlawful. Here's the old adage: "Ignorance of the law is no excuse."