Thousand years ago Naruto became Jubi. He had Kurama as a companion all along but unlimited power didn't really do anything about the boredom. So both of them thought of visiting another dimension for some entertainment. It was hard to open an inter dimensional pathway, but it was even harder to deal with the reality they ended up in.