There are some vaguely written rules about set swapping in the tooltip but the scenarios seem to be poorly translated.
Rule #1 states that L/G/D1/D2/D3 can be swapped to any D0/D1/D2/D3 however this isn't entirely true. A D1+ can be swapped with another D1+ but a D0 cannot be swapped with a D1+ or vice versa. A divine can seemingly only be swapped with another divine, same for legendary.
Rule #2 states that L/D1/D2/D3 can be swapped to Legendary. I do not have a legendary to test this
Rule #3 states that G/D1/D2/D3 can be swapped to Divine. This isn't true at all in my experience. I have set pieces from all tiers except D3 and regardless of item types matching I am unable to move anything to or from my Divine gear, hopefully someone can elaborate on this.
Rule #4 states that a D0 cannot be swapped under any circumstance. I feel like this is inaccurate but I have since dismantled all of my D0 gear and I cannot confirm/deny.
Hopefully my test data below will help.
D0 = Heroic Raid, Normal Team Raid
D1 = Normal Team Raid
D2/D3 = Heroic Raids
G = Divine Gear
L = Legendary Gear
D0 => D0 ( This is not possible, as far as I know )
D0 => D1 ( This is not possible )
D1 <= D0 ( I don't think that this is possible )
D1, D2 => D1, D2 ( A (D1) can be swapped with a (D2) as long as they are the same item type, for example, pants )
D2 => D2 ( These all appear to be interchangeable )
G => D0, D1, D2 ( This is not possible )
D0, D1, D2 => G ( This is not possible )
G => G ( I have not tested this but I assume this is possible )
L => G, D0, D1, D2 ( I do not have any legend gear to confirm but I would assume this is not possible based on previous tests)
G, D0, D1, D2 => L ( Probably same scenario as above )
L => L ( This should be possible as long as the item types are the same, I do not have any items to test this however)