Dragon level 20+ all give the same experience which is 14454 total. The other dungeons are similar, but you'd have to look up the exact XP reward unless an approximation is acceptable. Campaign 12-3 brutal gives 17304 total, and nightmare 38415 total. This is divided over your team, but you'll typically have 1-2 maxed farmer champions that won't benefit from their share. Formula for the effective XP gain per energy for any area would be
R * (T-F) / (T*E)
Where R is the total XP rewarded, T is the size of the team, and F is the number of farmers used.
So for example, 12-3 brutal with 1 farmer would give you 17304 * (4-1) / (4*8) = 1622.25 XP per energy spent, dragon 20 with 1 farmer would give you 14454 * (5-1) / (5*16) = 722.7, and dragon 20 with 2 farmers would give you 14454 * (5-2) / (5*16) = 542. Farming 25 with a duo would be quite inefficient, as it gives not only less dungeon diving points per energy compared to level 20, but also the XP per energy would drop to 433.6.
So obviously a hit, but you get more silver and dungeon diving points instead. I don't remember the exact numbers, but IIRC, dungeon 20 gave about 50-60% more dungeon diving points than 12-3, so whether you should farm campaign or dungeon 20 is more or less determined by whether you are in more dire need of dungeon diving or champion training points and we're not taking gear, silver or mystery shards into account.