Ultimately, a law is nothing more or less than a kind of rule agreed by a set of people.
It might be agreed by some and enforced by others, there may be an informal agreement on how such rules may be set or changed, and who they apply to, or principles the collection of people follow to form the rules and distinguish between rules that are valid and not valid. But since the rules we call "laws" only exist because enough people (or enough of some part of "people") agree they exist, they can always be changed if people agree, because there really isn't anything stopping them being changed upon agreement, and they have no independent existence other than an expression of human views.
So the answer is no, laws can't "protect" themselves. That's for two reasons - people can change their minds, and by the nature of laws it isn't really possible anyway (as far as we know):
The idea that people can change their minds is explored in other answers, so Im going to focus on "possibility". To see that it isn't possible anyway, even if we wanted to, let's do a thought experiment.
Suppose everyone in the country has somehow become illiterate, so we don't have any written knowledge. (That doesn't change any laws, but it saves us from referring to books and old legal cases to derail the argument.) In this world, I develop a mind ray that let's me impose a deep and fixed belief in everyones mind, so they honestly believe it and think it is self evident and true, and always has been.
Now I use that ray and reprogram everyone's beliefs so they forget anything about the US constitution (or whatever law you see as fundamental in your country), and reprogram them to believe there is a law - and always has been - that completely contradicts whatever law you hold most dear. They completely lack any knowledge anything else ever existed.
And this would then be the law, there would be no basis to argue otherwise.
You could metaphysically argue they didn't freely choose it, or that some universal principle "outside people" sets what is a "law", but they themselves would tell you that you are wrong, and its how the law is in your country; police would patrol it, judges would enforce it, and so on.
You'd also have to say what principle it was that set the laws... and an appeal to universal principle probably won't work at all well, in light of how diverse existing laws already are (which tends to show there isn't some external decision maker to appeal.to).
Another scenario, without rays: much of America dies, except 20 surviving factory workers. (Or perhaps 200000). Which laws passed by the 'old' USA will they not be able to decide differently, even if all 20 (or 200,0000) of them agreed they wanted a different law? Answer: no conceivable law couldn't be made differently if they wanted it.
People have at times tried to set laws that lasted forever. Nobody, and no society or legislative body, ever, anywhere, has succeeded.