Note: The origins of sayings and phrases are sometimes not known. While it's not the case for every expression, when it does happen what I'll usually do is list the popular or plausible theories that exist that try to determine where a phrase may have come from. If not that, then I'll try to at least include the earliest known quote of the expression being used in writing. These quotes often times come from old books, poems, or newspapers. They are to give you an idea on how old some of these idioms are. So, for example, if there's a quote of an expression that comes from a newspaper in 1905, then obviously the expression must be at least that old.
Being in a dilemma where the only two available options are both unsatisfying or bad.
The origin of this phrase is believed to be from the United States. According to The Phrase
Finder, the earliest known citation of this idiom being used is from the year 1921, in the Dialect
Notes V where it reads:
"To be between a rock and a hard place . . . To be bankrupt. Common in Arizona in recent
panics; sporadic in California."
Based on this quote, it seems this expression, at that time, meant 'to be bankrupt' which differs from the 'being in a dilemma' meaning it has today. The earliest I could find this saying in writing with its modern meaning comes from The Advertiser newspaper, 1930, where it's written:
"After that we were between a rock and a hard place. There was a lot of unpleasantness with
Mr. Romanes, but by and by we see'd we couldn't do nothing by fighting each other, so we
shared out the grub, and took what we each thought was the best road off . . . mantelpiece."
* Mariah found herself stuck between a rock and a hard spot when she received a big dent in her car; she either had to spend money to have it repaired, or drive around town with an unsightly dent on her vehicle.