Several daily trains come to Hue from Hanoi, Da Nang and Saigon (Ho Chi Minh City). From Hue you can also take buses to Hoi An, and Da Nang. It is also possible to get to/from Hanoi and Saigon by bus, but distances are too big.
If you take the train, I can only recommend coming to Hue from Hanoi (or vice versa) with the overnight train. If you want to go to Saigon, take a plane. Buses are only recommended for short distances (Hoi An and Da Nang).
♥ Visit Tagulandang Island ♥