This was the subject of a retcon after it became apparent that Ragnarok needed a big name supporting actor alongside Hemsworth. In short, the Hulk actually flew into space (at the end of Age of Ultron) where, after drifting for a while, he chanced upon a portal to Sakaar
What Feige is referring to is the last time fans saw the Hulk, flying
off in a Quinjet after being hurt by Black Widow. Joss Whedon
publically stated that he had planned to show the Hulk leaving Earth
and headed into space, but that the studio insisted on him changing
the color of the sky from black to blue to avoid giving fans the idea
that they were going to do a “Planet Hulk” movie.
“We said, ‘Joss, we can’t do that because he’s not going into space
and people are going to think we’re doing ‘Planet Hulk,’” Feige
recalls. “He goes, ‘Well, what are you going to do?’ We said, ‘We
don’t know.’ So, if you go back and look at that shot of the movie,
he’s in the sky. It’s blue sky."
Marvel also changed the Avengers: Age of Ultron script to avoid
confusion, removing a line that would have noted that the Hulk had
been located passing Saturn.
“So in the movie, it’s, ‘We lost the signal out by the Caspian Sea,’”
Feige says. “Or something like that, it was all earthbound.“
“Well, what if he did go to space?” Feige said. “We would jokily call
it Planet Thor, for a while. I went, ‘You know what that means?’ They
go, ‘What?’ I go, ‘That means Hulk went to space at the end of
Ultron.’ So, I had to tell Joss. And this was a year after Ultron came
out. It was kind of a big thing. We were like, ‘You gotta change it,
Joss, he’s not going to space.’ A year after, I go, ‘Joss, guess where
he’s going? He’s going to space.'”
How Marvel Retconned 'Age Of Ultron' To Add Hulk To 'Thor: Ragnarok'
While I was attending a Marvel set visit, Ragnarok production designer Dan Hennah opened during a roundtable discussion and said:
"Sakaar's populated by aliens and the, the sky in Sakaar has a number
of worm holes that deposit space waste, basically, and if you're
flying though space, you can get caught in a wormhole and you can end
up... Well, he hit one of these wormholes and he ended up here and he
became The Grandmaster's special toy, you know. He's the lead punch-up
How The Hulk Ended Up On Sakaar In Thor: Ragnarok