The stub axle only holds the bearings in place, nothing actually moves on it, so it doesn't matter if it's pitted or not, unless it is rusted and pitted that bad it compromises it's strength. Just clean it up with wet and dry and fit the new hub.
you obviously have not seen a bad pitted stub axle.
if it is... the outer race on the bearings will move and twist
which can be rather nasty
as I found out when I bought the VK. The wheel (actually the brake rotor) was wobbling
all around, could not work it out until I disassembled the whole thing.
Rusted and pitted stub axle allowing the inner and outer bearings to move around on the axle
= large worn grooves in the axle . Which of course accounted for the wheel movement