Don't do dodgeball. It's a completely different experience.
It's like anything else in this game, like aiming or learning good movement. You just have to keep practicing at it. There's no real trick or magic technique that'll make it easier. You just have to be good at timing, at reacting, and at predicting.
Think of it like a fighting game. The Pyro plays a lot like an aggro fighting game character: has to get in close to do lots of damage, does bursts of damage with combos, and tries to control the opponent into a defensive space so that you can remain on the offensive.