You can only retrain units (i.e., bring them back to full strength) in provinces that have the facilities to train them in the first place, but apparently you can do upgrades anywhere.

Say you've got a no-dachi unit with 40 men and no upgrades, and they're in a province that has a legendary armoury and swordsmith, but no sword dojo. If you drop them in the training queue, they'll come out with legendary weapons and armour, but with no new men, since there was no sword dojo to train them.
One thing I have noticed is occasional honour dilution in re-training. I had a NC unit which was down to one man, but the unit honour was up to 3 (without a general bonus). After I sent the unit through retraining, they came out at full strength with a unit honour of 1.

As for the losing generals being reset -- did you check that the name of the unit leader was the same? Maybe when they retrained, a new unit leader (and therefore a new general) was appointed.