You can play as all races. You just need a worker of each race. e.g. wisp, acolyte, peon, peasant. But tiers and upgrades won't necessarily transfer over. For example, if you have a castle as human, it doesn't satisfy the black citadel requirement for undead buildings. You would need separate ones (or you would have to make some specific system for your map).
It is kind of a weird idea though--especially when you think about mining gold. But it is possible. In fact, you can even do this in a melee map (if you're given enough time). Just use a banshee to possess a worker (or charm a worker). Then you can have fun building.
Off-topic, but interesting: When I first did the RoC campaign on insane, I possessed a high elf worker in the Sylvanas Sunwell level (the one where Sylvanas dies and gets raised, and you have to go to the Sunwell to rez Kel'thuzad). Funnily enough, I ended up making an entire high elf army, and I even made an altar to make heroes. For some reason, they didn't limit how many heroes you could make, so I actually made like 10 pallies for the hell of it. So when I attacked the sunwell, I basically had a raid of Arthas + 10 pallies. It did not make any sense whatsoever.
----
Anyway, I agree that your question should be a bit more specific.