It's called, arguing by analogy. Eugene Volokh addresses. I know what people mean when they say this, or think they mean: You made a bad analogy. The reason I think this needs discussion is folks seemingly take this phrase too literally. In doing so, they err. For instance, a Volokh commenter noted:
“Apples and Oranges” is a short-hand refutation of an argument assimilating one thing to another. It just means “they’re not the same.” And they’re not. It isn’t a matter of their not being comparable.
Wrong wrong wrong. Whenever one makes an analogy in an argument -- what lawyers and philosophers are paid to do -- one compares apples to oranges. As noted, folks mean when they use this term: You made a bad analogy because the subjects, in the context discussed, distinguish meaningfully.
Yet, how likely is it, in a given context, that an apple so meaningfully distinguishes from an orange. They are both fruits; they are both round, baseball sized of similar mass. Perhaps a lemon better analogizes to an orange, a pear to an apple. But apples to oranges compare much better than apples to typewriters or apples to skyscrapers.
I know I shouldn't be so pedantic. There are many words and terms whose on their face meaning is ironic, oxymoronic or otherwise problematic. "Homophobia"; "Anti-Semitism"; "sleeping together."
But still, some seemingly bright folks don't seem to realize that apples to apples means to compare duplicates. To demand an apples to apples comparison, in a strict sense, what some folks do to try to win arguments, is to say X is sui generis, that is it is off limits to ANY ANALOGY because it can't be compared to ANYTHING that is not X.
How convenient for that side.
In reality, everything is sui generis, if you want, for the sake of argument. If that's so, the door to arguments from analogy closes. Once that door opens, nothing is sui generis.
How does this play out in real world argument? Let's see:
I say, “I should have a right to marry someone of the same sex.” You counter, “if that’s true, then I should have the right to marry two women not just one.” I reply, “you have compared apples to oranges.” And that’s because, charitably towards your argument, you have. (In an uncharitable sense, you have compared apples to typewriters.)
Change the context. I say, "I should have a right to marry someone of the same sex." You reply, “no you shouldn’t.” I counter, “but you support letting people of different races marry.” You reply, “you have compared apples to oranges.” And that’s because I have. (Ditto with the charitably concept.)
Apples to apples compares same sex marriage to same sex marriage. Oranges to oranges compares polygamy to polygamy. Lemons to lemons compares miscegenation to miscegenation. Someone tries to argue for X, and in doing so you find yourself comparing it to Y, you compare apples to oranges. X is not Y. X is X. Y is Y.
In terms of charitable readings, one predisposed to same sex marriage might argue same sex marriage to interracial marriage is apples to oranges (a good analogy), same sex marriage to polygamy is apples to typewriters (a bad analogy). Or one predisposed against same sex marriage would note same sex marriage to interracial marriage as apples to typewriters (a bad analogy); same sex marriage to polygamy, apples to oranges (a good analogy).
But, be sure, NO ONE when they argue from analogy, argues "apples to apples." The best you can do (probably) is apples to oranges. Maybe, if you are really lucky, you get an oranges to lemons. Perhaps, if you are super lucky, oranges to tangerines. But once you get to apples to apples, you no longer argue from analogy but rather, sui generis.