Increase your vertical leap. You will need the lifting power of your legs to get you in the air and up to the basket. Building a regimen of leg workouts that will increase the fast-twitch strength and the flexibility of your leg muscles can help you add inches to your vertical leap, getting you that much closer to the rim. A good regimen to get started with might include:
Learn about plyometrics. Plyometrics are exercises that use the resistance of your own body to build strength and are essential for building the kind of strength necessary to build your jump. It takes time to train your body to jump higher, but working the right muscle groups can improve your explosiveness and height without maxing out regularly in the weight room.
Work on your flexibility. Just building strength in your legs won't do it. The muscles also need to be loose and flexible, giving you the movement and response you'll need to dunk over the defense. Develop your flexibility by regularly stretching, doing elastic resistance exercises, and giving yoga a shot.