Germans and the Ottoman rulers of Palestine were allies in WW1. There was a German diplomatic, technical and military advisor presence there.
In WW2 there was a similar German presence (at least until ‘42), but I had always understood it to be much smaller than in WW1.
I’ve never seen any precise details though.
If you are suggesting that the Brits would have allowed German troops in the Palestine Mandate between 1939 and 1942 (”In WW2 there was a similar German presence (at least until ‘42)”), I’ll call. Show your cards.
While the Vichy French allowed Germans access to bases in Syria, the British certainly didn’t allow them access to the Mandate.
In the Spring of 1941, air battles began between the French and Germans on one side, and the British (and Colonial) troops on the other. In June, 1941, British forces moved against the French in Lebanon and Syria from Palestine and Iraq. Damascus quickly fell; it took until mid-July to take Beruit.
Thus, by summer, 1941, not only the Germans, but the French as well had been cleared from the Middle East. (The British did allow their ‘Free French’ puppets to assume nominal control).