The main reason you can't do it on the bike is drag.
The wheel bearings and dust caps/bearing covers create enough drag on the axle that you would not get anything near accurate for balance.
On the other hand, balancing a wheel on a dirt bike isn't critacal, and some feel the same way about street bikes as well.
If you are on the road changing a tire, you can skip the balance and just fix the tire. Doubtful you will notice untill you are at speed on the road. And even then it wont be dangerous or dramatically affect handling.