united-states
Generally speaking, selective enforcement by a regulator is not actionable in U.S. law, nor is it a defense to a prosecution.
A regulatory agency has no legally enforceable duty to enforce the law in the same way against every possible violator of the law. See, e.g., Railway Express Agency, Inc. v. New York 336 U.S. 106 (1949) (It is no requirement of equal protection that all evils of the same genus be eradicated or none at all.)
It is fundamental that selectivity in the enforcement of criminal laws
is subject to constitutional constraints. Nevertheless, the conscious
exercise of some selectivity in enforcement is not in itself a federal
constitutional violation so long as the selection was [not]
deliberately based upon an unjustifiable standard . . . . [t]here is a
presumption that prosecution for violation of the criminal law is in
good faith.
United States v. Amon, 669 F.2d 1351, 1355-56 (10th Cir. 1981), cert. denied, 459 U.S. 825 (1982) (citations and some punctuation marks omitted).
To support a defense of selective or discriminatory prosecution, a
defendant bears the heavy burden of establishing, at least prima
facie, (1) that, while others similarly situated have not generally
been proceeded against because of conduct of the type forming the
basis of the charge against him, he has been singled out for
prosecution, and (2) that the government’s discriminatory selection of
him for prosecution has been invidious or in bad faith, i.e., based
upon such impermissible considerations as race, religion, or the
desire to prevent his exercise of constitutional rights.
United States v. Berrios, 501 F.2d 1207, 1211 (2d Cir. 1974).
A review of challenges to selective enforcement of statutes raised as a defense to a selective prosecution in the tax area, with related case law, can be found here.
There is such a thing as "group of one" discrimination under the equal protection clause, but it requires a showing a personal animus unrelated to any regulatory purpose and a singling out of someone for enforcement that is literally enforced against no one else. See Village of Willowbrook v. Olech 528 U.S. 562 (2000) (The Equal Protection Clause gives rise to a cause of action on behalf of a "class of one" when the plaintiff does not allege membership in a class or group, but alleges that they have been intentionally treated differently from others similarly situated and that there is no rational basis for such treatment.)
The typical "group of one" equal protection clause case involves a local government enforcing a zombie law against someone that a local official has a grudge against for some unrelated reason like the regulatory target's son being unfaithful to the local regulator's daughter.