Toilet-Bound Hanako-kun is purely imaginative. It's a work of fiction that comes from the creator's imagination rather than real-life happenings. There's no real story behind it.
Hanako-kun's story in the manga was full of twists and turns. He encountered new friends and enemies, and his powers evolved as he took on more difficult tasks.