If wishes were horses is the first part of a popular idiomatic expression, used to describe wishing for things as useful as Beating a Dead Horse.
The entire idiom goes: “If wishes were horses, beggars would ride”.
It also appears in a variation of nursery rhymes, revolving around the concepts of if-s and but-s.
The history of the proverb goes back several centuries, with the first recognizable version of the phrase appearing as “If wishes were thrushes, beggars would eat birds” in 1605, in the “Remaines of a Greater Worke, Concerning Britaine”, published by William Camden.
“If wishes were horses” first appeared in its currently known form in “A Complete Collection of Scotish Proverbs: Explained and Made Intelligible to the English Reader”, published by James Kelly in 1721.
“If wishes were horses” became a widely popular saying over the centuries, being featured in a wide variety of nursery rhymes, which might as well be the actual source for the proverb.
It also emerged in several popular iterations, such as the rhyming “If wishes were fishes, we’d all swim in riches”, which first appeared in print in the late 19th century.
Since then, both the original idiom and its variations have become a popular commonplace in English, used to dismiss senseless daydreaming.