Quoted from d20:
Base Speed: (Slow and Steady) Dwarves have a base speed of 20 feet, but their speed is never modified by armor or encumbrance.
and
A barbarian’s land speed is faster than the norm for her race by +10 feet. This benefit applies only when he is wearing no armor, light armor, or medium armor, and not carrying a heavy load. Apply this bonus before modifying the barbarian’s speed because of any load carried or armor worn. This bonus stacks with any other bonuses to the barbarian’s land speed.
So a dwarf can never be slowed by any kind of armor, but barbarians lose the +10 feet of movement when wearing heavy armor.
Which takes priority over the other?