I think people overestimate the strength of Dragon Ball characters;
It's true that they have power to destroy the earth and to fly around it very fast, at least since the Majin Buu Saga, but the earth in the Dragon Ball universe is much smaller than the real one, and also much smaller than the world of One Piece.
And Sanji has shown some very impressive feats in his fight with Queen, such as having a sword broken on his skin, being able to recover all his broken bones in an instant, moving at invisible speed for a relevant time, creating fire that is hot enough to be blue with lightning, and catapulting a cybernetically strengthened brachiosaurus to far high in the sky.
Keep in mind that Sanji can do on his own what Dragon Ball characters need a senzu bean in order to do...
Not to mention that even before the time-skip, in a special, Sanji kicked a soccer ball, which seemed to miss the goal, but it actually flew around the world before entering the goal...
This is not canon, of course, but Oda himself participated as a voice actor in the special, so I think this tells a bit how strong Sanji was supposed to be at the time...
So I believe Sanji would be able to defeat at least Goku when he beat Piccolo Jr in the tournament, without problem.
Against Goku when he turned into Super Sayajin for the first time would be a harder fight, but I think Sanji would still have a chance.
It's hard to tell how much stronger Goku became as Super Sayajin 2, so I guess it's arguable that Sanji would beat him as well.
I don't think Sanji would beat Goku in the Majin Buu Saga though, since he's comparable to Gotenks, who was able to fly very fast around the earth in Dragon Ball's universe, which is still very big even though much smaller than the World of One Piece.
It's true that they have power to destroy the earth and to fly around it very fast, at least since the Majin Buu Saga, but the earth in the Dragon Ball universe is much smaller than the real one, and also much smaller than the world of One Piece.
And Sanji has shown some very impressive feats in his fight with Queen, such as having a sword broken on his skin, being able to recover all his broken bones in an instant, moving at invisible speed for a relevant time, creating fire that is hot enough to be blue with lightning, and catapulting a cybernetically strengthened brachiosaurus to far high in the sky.
Keep in mind that Sanji can do on his own what Dragon Ball characters need a senzu bean in order to do...
Not to mention that even before the time-skip, in a special, Sanji kicked a soccer ball, which seemed to miss the goal, but it actually flew around the world before entering the goal...
This is not canon, of course, but Oda himself participated as a voice actor in the special, so I think this tells a bit how strong Sanji was supposed to be at the time...
So I believe Sanji would be able to defeat at least Goku when he beat Piccolo Jr in the tournament, without problem.
Against Goku when he turned into Super Sayajin for the first time would be a harder fight, but I think Sanji would still have a chance.
It's hard to tell how much stronger Goku became as Super Sayajin 2, so I guess it's arguable that Sanji would beat him as well.
I don't think Sanji would beat Goku in the Majin Buu Saga though, since he's comparable to Gotenks, who was able to fly very fast around the earth in Dragon Ball's universe, which is still very big even though much smaller than the World of One Piece.