Both are these mysterious figures related to esoteric knowledge, and al-Khidr seems to mean "the green one." At first I thought the Green Man was a more celtic figure, but then I learned that representations of the Green Man have been attested in parts of the Middle East, so there is a geographic overlap between these two figures. Could they have a common origin?
I hate to break it to you, but the so-called "Green Man" did not exist as a mythic figure before the twentieth century; he is entirely the invention of one twentieth-century English amateur folklorist. I wrote an entire article about this on my blog last year in which I explore the history of the Green Man in depth.
The image of a man's face surrounded by leaves and foliage, sometime with his mouth open disgorging foliage, occurs in ancient, medieval, and early modern art solely as an artistic motif; there is no evidence of any mythology or folklore attached to this face. In fact, we have no record that this artistic motif ever even had so much as a name.
Then, over the course of the nineteenth and early twentieth centuries, the field of western folklore studies emerged under the dual influences of the Romantic movement and nationalism, which both emphasized the idea of enduring cultural continuity with the distant past.
Nineteenth and early twentieth-century western folklorists tended to automatically interpret basically any aspect of contemporary western European folklore that was not explicitly and obviously Christian as a "survival" from ancient, pre-Christian "paganism," regardless of whether there was any evidence to connect it to any attested ancient pre-Christian idea or practice. The prime representative of this trend was the Scottish anthropologist Sir James George Frazer (lived 1854 – 1941), who is known primarily for his highly speculative monograph The Golden Bough, which he originally published in two volumes in 1890 with the subtitle A Study in Comparative Religion.
It was in this intellectual milieu that the British aristocrat and amateur folklorist Julia Somerset, Lady Raglan, single-handedly invented the entire concept of the "Green Man" in a single article of only thirteen pages with the rather inconspicuous title “The ‘Green Man’ in Church Architecture,” originally published in the March 1939 edition of The Folk-Lore Journal (later retitled Folklore).
Lady Raglan declared that the foliate heads that appear on church buildings going back to the Middle Ages are, in fact, representations of a specific mythical figure. She coined the name "Green Man" herself to describe this figure and also basically made up the entire mythology surrounding him, drawing heavily on Frazer's earlier speculations.
Lady Raglan's wildly imaginative reconstruction of the "Green Man," however, took off and became widely disseminated throughout popular culture in way that few academic theories ever have before or since. Now the idea is so pervasive that nearly everyone thinks that the Green Man is an extremely ancient, pre-Christian, "pagan" deity, when, in reality, he's not ancient at all.
Needless to say, since the notion of the Green Man as anything more just an artistic motif is the invention of one twentieth-century Englishwoman, he has nothing to do with al-Khiḍr.