d7, sounding exactly like M6, are both considered dissonant, but their 'twins' are both consonant?
I think it is the combination of the placement within the scale and the alteration of tones from diatonic. By diatonic I mean the diatonic gamut
ABCDEFG and its transpositions. There is no diatonic
d7. If we consider the commonly used example of leading tone
^7 and flat
♭^6, it's nine half steps, but it also involves an altered tone, either the lowered sixth degree in major, or the raised seventh degree in minor.
The alteration is the important point. A
d7 is enharmonically equivalent to
M6, but the fact that a tone must be altered from diatonic is heard, the ear recognizes the deviation from diatonic... and it matters.
The general rule is any interval altered to a diminished or augmented interval is considered dissonant, because of the alteration, regardless whether that resulting interval is enharmonically equivalent to another consonant interval.
So, for example, in
A♭ are a
d7, 9 half steps, and dissonant, but while
C is a
M6, and also 9 half steps, it is a consonance. The difference is the chromatic alteration.
To put it another way: the only diatonic sixth below
C minor is on
C♮, a minor sixth
M6 below would be a
C♭, at which point the tonic is altered and things would just become crazy. If you come at it from below, and try to make a
M6 above the lower tone, it's starting with an altered seventh degree
B♮ up to a
G, in this case a
G#, which is a second alteration, this time on the dominant.
That's a lot of mucking around with those particular scale degrees. Either the enharmonic spelling to force sixths start to suggest a likely change of tonal center, or we accept that altering intervals to anything that becomes diminished or augmented creates dissonance.
Why? Well, my answer would be the "weirdness" of the chromatic alterations. That may seem arbitrary, but remember, there is no absolute measure or definition of dissonance. The acoustical definition is about simple ratios, but the destabilizing aspect of chromatic changes to the diatonic gamut are also a stylistic factor. Chromatically altered, non-diatonic "weirdness" is dissonance... because the harmonic style says so. This gets to the other part of your question.
So how would a decision be made to change one interval from one [consonant] to the other [dissonant]
The perfect fourth already provides a historic example. Some styles treat it as a dissonance (which I think makes little sense to modern ears like mine), other styles treat it as a consonance. In the style that treats it as a dissonance it gets treated strictly as a proper suspension were the "dissonant" fourth must resolve to a third. That's just a choice, but it makes the character of that particular harmonic style. To treat it like a consonance you could do things like play parallel
6/3 chords or maybe hit that interval as an appoggiatura, etc.
Notice that the difference between the two treatments is not about some absolute quality of a perfect fourth but rather the context in which it is used. When my 21st century ears hear a suspension figure in Palestrina I don't literally hear dissonance, but I understand in that style the suspension treatment is what casts the interval as a dissonance. It's the musical equivalent of putting a fig leaf on a Greek nude sculpture. The thing in question is not inherently offensive, but the treatment of it let's the audience know how it is regarded.
So, how to make a dissonance a consonance? Literally just do it. Modernism basically treats seconds, fourth, and seventh, etc. as intervals that do not need special handling as dissonances. That in effect makes them consonances. Personally, I think Debussy is the composer to listen to for this stuff. His music is so beautiful, so sensual, so expressive, and those moods were achieved many times with intervals that would conservatively be called dissonant. He didn't treat traditional dissonances as dissonant and so achieved new modes of harmonic expression.
Jazz is the other obvious place to look for dissonance recast as consonance. To the extend that non-chord tones would be dissonances, it's hard to identify any melody tone as a non-chord tone in jazz. Everything up to the thirteenth can easily be labeled a chord tone. The fourth is the one interval that jazz still seems to treat as a dissonance. Ironic, because the fourth as dissonant is such an old concept.