To those not understanding why Esemori was able to be brought back to town, at least in the US, Cancer patients with not much time left can be brought home by a family member. One of my uncles was brought home a few days before his death (He was pretty much in the same state Esemori is in) to be with the family.
Cancer patients being brought home is fairly common, especially when nearing the end of their lives.
Anyway, Esemori expressed a desire to die with Yuko beforehand once or twice anyway, so if he had the chance, this was to be expected. Not sure why this is a shock to people or people deem this unrealistic...