If you disband a unit while in training you'll get compensation for the workers and how much the unit would cost (metal/oil) without overhead (so can be costly late game when you've got a high overhead).
If you disband a unit after training, you will only receive the workers, no compensation for the metal and oil costs. Infantry will give you one worker, Vech will give you 2 workers, Tanks will give you 3