I think there are elements of truth to it, which should be something that prompts self-reflection in Israel.
But I will also say the situation is quite unique in Israel because it fought an actual war of survival with its Arab neighbors in 1948, and only signed an Armistice with them–not a peace treaty. The war continued in 1967 with again, all of Israel’s Arab neighbors fighting it (and losing)–this resulted in the Israeli occupation of the “Occupied Territories.” There was then a three year period of fighting in Sinai called the “War of Attrition”, and then the 1973 Yom Kippur War, again between the original parties of the 1948 war. This war lead to the 1978 Camp David Accords, which finally saw Egypt and Israel sign a peace treaty, but Israel remained at war with all of the other participants of the 1948 war for years after, and in fact is still legally at war with Syria and Lebanon today.
The Israeli political leadership class is old (as is true of most countries), many of them are veterans of these wars. This strongly shapes the way people think–there are many observed political trends that historians have linked to the veterans of the American Civil War running the country for the next 30 years, Veterans of WWII doing the same later on and etc, being in something as traumatic as a war causes life long changes in how one thinks and behaves. South Africa really faced nothing like this. Israel for about 30 years very legitimately could say it was engaged in actual war with all of its neighbors, and as part of that war it occupied territory that, previously being under Arab occupation, was a grave strategic threat to Israel in this war.
It would be like if in addition to the domestic issues of apartheid South Africa, there were 5 powerful African countries, who occupied territory that nearly cut South Africa in half, ringing South Africa and in a state of legal war with it. This element cannot be fully dismissed or forgotten.
The fact that shooting wars broke out 3 times in 25 years created pretty strong justification for Israel to act and behave as if it was facing grave security threats, which justified occupying territory for defensive purposes.
Also different from many “colonial” powers, if Israel leaves those territories, it isn’t like France leaving Vietnam or America leaving the Philippines. The occupied territories are not thousands of miles away, they are next door.
Now all that being said, the world has changed over time. Over the decades after the Camp David Accords in 1978, arguably any real risk of “hot war” with Israel’s Arab neighbors declined precipitously, in fact Israel went on to eventually make peace with most of these neighbors other than Syria/Lebanon, and Syria’s military capacities are minimal compared to Israel’s and Lebanon is only vaguely even an independent state.
What started as a strategically justifiable, especially given the actual genuine threats to national survival, defensive occupation, has slowly morphed into…something else entirely. However Likud and its political leadership, and indeed much of the right in Israeli society, still largely talk about this conflict and the occupation in the context of the wars between 1948 and 1973. This isn’t entirely crazy person behavior, if you were a veteran of those wars they are much more salient in your mind than they are to a person who is 30 or 40 years old and wasn’t alive or was a baby during those wars. Much of the political leadership on the Israeli right were literally “baptized in fire” of major wars with a coalition of Arab states. That context I think is important for understanding the behavior involved.