That stub looks better than what's on a lot of the landscaping trailers I work on.
Most trailer hubs and bearings are standard sizes for the weight rating of the axle. Some boat trailers' hubs, bearings and seals are funky sizes, especially when you get into surge brakes, and mobile home axle parts won't interchange with anything, but non-home built utility trailers have standard bearings, hubs, seals, castle nuts, lock washers, etc...
That one looks like it could be fixed if in a pinch. The stuff on the bearing surfaces is just grease that has collected burnt up metal from the rollers and turned to a rusty looking paste. The flat part of the threaded portion is to locate the lock washer for the castle nut.
Considering what the other hub may look like, locating parts to fix what you know is wrong, wondering if the stub got weak from the heat, finding a die to chase the threads on that damaged stub, and as cheap as an end-to-end axle assembly would cost, it's easier and more cost effective to buy a new axle.