If ifs and buts were candy and nuts is a popular idiomatic expression, used for highlighting the fact that wishes rarely come true, thus wishing for things is futile and senseless.
“If ifs and buts were candy and nuts” originates from an older nursery rhyme, If Wishes Were Horses, which is widely attributed to Sir Thomas More, who is incidentally also cited as the earliest source for the saying Penny for Your Thoughts.
“If ifs and buts were candy and nuts” was created on the basis of the aforementioned nursery rhyme by Don Meredith in a 1970 broadcast of the Monday Night Football, where a sports commentator said, “If Los Angeles wins” to which he replied, “If ifs and buts were candy and nuts, we’d all have a merry Christmas”.
“If ifs and buts were candy and nuts” became a widely popular expression in the Anglosphere, especially in the United States, where it even appeared in television series, such as the Season 4 Episode 7 of The Big Bang Theory which was first aired on December 28th, 2010.
Since then, many other series like The Simpsons and The Office, as well as publications and movies have used the expression, further embedding it in the subconscious of English speakers.