Cao Cao is also known as Cao Amo. Because he was too greedy, and because he was the king of a country during the Three Kingdoms period, it would be difficult for the underworld to directly send him to hell. So with a wave of his hand, the King of Hell descended into a parallel world to eliminate the greed in his heart. As for going to the One Piece world, it can only be said to be Yama's personal hobby.