Of American-English origin, the phrase to have, or to get, etc., egg on one’s face means to be, or to get, embarrassed or humiliated by the turn of events.
The earliest instance of the phrase that I have found is accompanied by its definition; it is from Colorful Comments Cause Confusion, published in the Amarillo Daily News (Amarillo, Texas) of Friday 17th May 1946:
Hollywood—Alfred Hitchcock has discovered that having a reputation as a wag has its drawbacks.
Hitchcock has a language all his own in the making of “Notorious.”
For example, he suddenly halts a scene between Cary Grant and Ingrid Bergman to inform her that she has egg on her face.
“Yes, I could feel it,” Ingrid replies.
But no egg is removed or is visible as the stars resume the scene. When Hitchcock says an actor has egg on his face he means the actor has a vaguely embarrassed expression caused by too long a period without lines or a lag in action. “Hitch” removed the egg by speeding up the tempo of the scene.
The second-earliest instance that I have found is from the Binghamton Press (Binghamton, New York) of Wednesday 28th April 1948:
Harold Stassen […] rides a good horse toward the Republican National Convention in Philadelphia on June 21. […]
Next week he’ll break political lances with Senator Robert Taft in Ohio which is Senator Taft’s home state. All the indications are that he is going to make a good showing there. Stassen’s strategy is to enter his convention delegation nominees, not in the state as a whole, but in districts where Taft is weakest. These include the cities of the great industrial horseshoe where the labor vote is heaviest. The Minnesotan is going to win enough Ohio delegates to leave Taft with egg on his face.
This cartoon, published in the Binghamton Press (Binghamton, New York) of Wednesday 28th April 1948, depicts Taft and Stassen racing each other in the Ohio Primaries:
In the early 1950s, the phrase was often considered “part of the new language that has grown up with television”, as explained for example in the Wilmington Morning News (Wilmington, Delaware) on Thursday 4th October 1951:
Egg on his face—this is behind-the-scenes talk to describe the expression of an announcer or an actor when the camera stays beamed on him after he has finished his lines. The expression usually melts down to a sickly grin.
(This corresponds to the above-mentioned use of the phrase by Alfred Hitchcock.)
first possible origin
The following letter might support the ‘egg-throwing’ origin; it was published in The Philadelphia Inquirer (Philadelphia, Pennsylvania) on Sunday 22nd October 1944:
To the Editor of The Inquirer:
I read about the egg throwing when Frank Sinatra sang “I Don’t Know Why” in New York. I think the boy who threw the eggs had a lot of nerve. If I was sitting near him he would get more than eggs in his face. Why did he waste his money if he didn’t like Frank’s singing? He thought it would be fun to hurt someone’s feelings. I think Frank was swell to release him.
I’m not speaking just for myself, but in behalf of all the other bobby-sock wearers who think Frank is solid!
Philadelphia, Oct. 19.
On Saturday 8th April 1944, The Des Moines Register (Des Moines, Iowa) quoted a piece originally published in the Winnipeg Free Press, in which one Bruce Hutchison explained the symbolic significance of egg-throwing:
Every sane man in the world has long cherished a secret hope of throwing eggs. It is one of the primal instincts of the race, and only the conventions of society and the shortage of eggs have prevented the wholesale indulgence in it . . . Throwing eggs at another . . . is an act of deepest symbolism, and it symbolizes the unity of mankind. This fact may not appear at once to the traveler who has received the egg in his face, but after thought and ablutions, he will see that the whole fact of human equality, and the basis of the democratic system, are represented in the spectacle of a yolky visage. The custard pie of the old movies was equally symbolic but an egg is better, as you don’t have to be an expert to handle it. The egg and the custard pie are never thrown by the thoughtful man to injure any humble human being. They are thrown invariably, and with high motives, to destroy the pretensions of the vain man. Thus they assert, with more authority than any law, the essential equality of the whole human race . . . To us, unlike the Germans, it is never funny to see the weak injured. We do not throw eggs or pies at the heads of poor widows. We throw them at the top hats of tycoons and the stuffed shirts of society.
second possible origin
The following supports the theory that the phrase alludes to a yolk-smeared face after the careless eating of a soft-boiled egg; it is from The Arizona Daily Star (Tucson, Arizona) of Sunday 25th July 1954:
Mr. Average Motorist is a nice enough guy around the house, and might even be a Milquetoast individual in his business world. But sit him behind the wheel of an auto and he’s an unbluffable bear, carrying a shoulder chip the size of a two-by-four.
What Mr. Motorist fails to realize is that no one’s going to point him out as a sissy for acting like a human being able to stand aside and let someone else go first without grumbling like a schoolboy caught with egg on the face.