Where does the phrase "No ifs, no buts, no coconuts" come from?
Solution 1:
An online search suggests that the expression you ask about may have been patterned on an earlier children's schoolyard (or lunchroom) expression with a very different meaning:
No cuts, no butts, no coconuts.
(often rendered as "No butts, no cuts, no coconuts"), where cuts refers to "cutting in line" and butts to "butting in [line]."
Native U.S. English speakers may be familiar with the warning cry "No cuts!" in elementary school and middle school lunchroom lines. In this parlance, cuts referring to the practice of a kid coming late to the line and joining a friend who has already been standing in line for some time, ahead of others who have also been standing in line and don't appreciate being delayed further by line-jumping latecomers. The jingle-like longer phrase turns the warning into a stylized chant.
Google Books searches yield a meager supply of these various phrases in action. First occurrences of the various forms appear in this order: an instance of "No Cuts, No Butts, No Coconuts" as a song title from 1999; an instance of "No Buts, No Cuts, No Coconuts!" as a children's book title from 2008; an instance of "No cuts, no buts, no coconuts" in Wreck-It Ralph (2012); and an example of "No ifs, no buts, no coconuts" from Evil is Taking Over the Establishment - Origins (2014).
The butts versus buts issue isn't something you asked about, but it seems to me that in the case of the no-cutting-in-line chant, the butts spelling makes more sense—whereas in the no-ifs-or-buts saying, buts is clearly the intended word.
In an extended discussion of "No cuts, no buts, no coconuts," Barry Popik's Big Apple site locates a first instance from the TV show Hey Arnold! from 1997. (Note that the example is spoken not written, so the spelling but is attributive. In fact, Popik's discussion doesn't address the buts/butts issue at all, nor does it acknowledge the existence of the "no ifs, no buts, no coconuts" variant.
UPDATE (June 3, 2017): I should mention two other confirmed early occurrences of related phrases. One is an instance of "no ifs, no buts, no cuts" from 1999 (probably) in Legal Action: The Bulletin of the Legal Action Group, where the meaning might be read as "no arguing or equivocating—cutting is not allowed"; the other is a much later instance, from Acid (2008), which gives the expression as "no buts no cuts, no alligator guts"—a retort by one juvenile character to another, who has just uttered the one-word objection, "But."
Solution 2:
As another answer mentions, it is a children's phrase.
I can't speak for others, but as a kid growing up in the U.S. playing baseball and football I heard coaches say this from time to time. The spelling in the use I heard would be "no cuts, no buts, no coconuts".
The references were slightly different than in other answers but this these differences are almost certainly regionalisms -- the spirit of the phrase is the same.
- "No cuts" equates to no cheating (no shortcuts -- relevant in line-cutting, but also more generally applicable)
- "No buts" means no excuses would be accepted ("butting" in line makes sense, but it wasn't the context of use when I used to hear this)
- "No coconuts" forbids stupidity ("coconut" means, in this context, someone who was empty-headed -- roughly the way the character Rocky Balboa uses the word)