Laws/ legislation which contradict God's Laws are NOT laws.
From Sir William Blackstone's Commentaries on the Laws of England (Volume 1, Section II – Of The Nature of Laws in General)
“This Will of His Maker is called the law of nature. For as God, when He created matter, and endued it with a principle of mobility, established certain rules for the perpetual direction of that motion, so, when He created man, and endued him with free-will to conduct himself in all parts of life, He laid down certain immutable laws of human nature, whereby that free-will is in some degree regulated and restrained, and gave him also the faculty of reason to discover the purport of those laws.
... This has given manifold occasion for the benign interposition of divine Providence, which, in compassion to the frailty, the imperfection, and the blindness of human reason, hath been pleased, at sundry times and in diverse manners, to discover and enforce its laws by an immediate and direct revelation. The doctrines thus delivered we call the revealed or Divine Law, and they are to be found only in the Holy Scriptures.
These precepts, when revealed, are found upon comparison to be really a part of the original law of nature, as they tend in all their consequences to man’s felicity JAHTruth.net/blescur. But we are not from thence to conclude that the knowledge of these truths was attainable by reason, in its present corrupted state; since we find that, until they were revealed, they were hid from the wisdom of ages. As then the moral precepts of this law are indeed of the same original with those of the law of nature, so their intrinsic obligation is of equal strength and perpetuity. Yet undoubtedly the revealed Law is of infinitely more authenticity than that moral system which is framed by ethical writers, and denominated the natural law; because one is the law of nature, expressly declared so to be by God Himself; the other is only what, by the assistance of human reason, we imagine* to be that law.”
- King of kings' Bible Genesis 6:5 And "I AM" saw that the wickedness of man [was] great in the earth, and [that] EVERY imagination of the thoughts of his heart [was] only evil (from the Devil) continually.
“If we could be as certain of the latter as we are of the former, both would have an equal authority; but, till then, they can never be put in any competition together. Upon these two foundations, the law of nature and the Law of Revelation, depend all human laws (legislation); that is to say, no human laws should be suffered to contradict these. There are, it is true, a great number of indifferent points in which both the Divine Law and the natural leave a man at his own liberty, but which are found necessary, for the benefit of society, to be restrained within certain limits. And herein it is that human laws have their greatest force and efficacy; for, with regard to such points as are not indifferent, human laws are only declaratory of, and act in subordination to, the former.”
Link - The Law: The Song of Moses and The Song of The Lamb
Lawful defences against legalities:
Link -- UK and Territories
Link - Rest of the world