The Lanham Act imposes on a trademark's owner the requirement that the mark be used lawfully in commerce. If it is not, the USPTO should refuse to register it, and if registered the registration should be cancelled. As well, unlawful use of a mark in commerce has been applied as an affirmative defense to infringement in the case of registered marks, and there is no basis to distinguish, for this purpose, registered and unregistered marks. It's just that the tested cases have been with registered marks.
To obtain trademark rights, the mark must be used in commerce; a mere intention to use a mark fails to create rights. The TTAB has adopted and applied a "lawful use in commerce" doctrine, the effect of which is that goods bearing a mark shipped in violation of a federal statute leaves the mark unregistrable or if already registered, unenforceable.
One purpose behind this lawful use doctrine is to regulate honest trade among merchants, and not reward merchants who deceive the buying public; and certainly an aim of the courts and the USPTO is not to help merchants achieve their aims by enforcing their marks when their marks are used unlawfully. As one court ruled, "In all cases of unfair competition, it is principles of old fashioned honesty which are controlling." Radio Shack Corp. v. Radio Shack, Inc., 180 F.2d 200, 206 (7th Cir. 1950).
While a number of these cases result from the violation by a mark's owner of the Food, Drug & Cosmetic Act, this law is by no means the only federal act for which the affirmative defense has been raised when the allegation has been a violation. For example, the defense has been revised for alleged violations of the Federal Meat Inspection Act, the Federal Clean Air Act, the Amateur Sports Act of 1978 and the Federal Insecticide, Fungicide and Rodenticide Act.
It is the clear rule that a mark's owner must use its mark lawfully in order to enforce its rights against would-be infringers.
Unlawful activity that will result in problems for the owner can be found in false statements made to the USPTO for purposes of registration, or in ad copy, or other claims, made to induce consumers to buy the goods associated with the mark. Even failure to comply with labeling requirements can be considered unlawful use in commerce and result in loss of enforcement rights. Of course, there must be a nexus between the use of the mark and the allegedly unlawful activity, and generally, the unlawful use must be material. Merely collateral unlawful use likely won't result in loss of rights.
For a more detailed treatment of this topic, see Astrachan, James B., Unlawful Use in Commerce and the Affirmative Defense to Infringement: When Trademark Rights are Not What They Appear to Be, Syracuse Law Review, Vol. 69, No. 2 (2019).