Which trick do you mean? Are you talking about the standard pick up a ball and drop it through a hoop or are you wanting an airbud style bouncing ball off his nose into a basket?
I've never taught the first version. It seems like a pick up and drop trick, perhaps you could adapt the methods for training put away toys?
With the second trick I taught my dog to bounce a ball off his nose - easy for a soccer obsessive dog - just throw him a ball that is too big to hold and reward highly for a nose pass rather than a paw save, then reward only for passes that you can catch, now you have a dog that can target the ball. Then I was fortunate because my dog figured out instantly that if I touch or point at an object that is his target. I don't really know how he worked it out but I started with a big target (a washing basket) just beside me so that if I didn't catch the ball it'd fall in and then I rewarded highly for a "basket" (LOL his FACE when the ball fell in the basket, it was like "Hey did you SEE that!"). Now after a lot of small increments I am using a bucket slightly above his head height and gradually moving it higher. Keep sessions short, 2-3 successes are enough, this is pretty tiring for a dog. Use mega rewards, Zac gets up to 5 minutes playing soccer or a similar length of time petting for every successful basket, he won't work for food with this trick but if he did it'd be whole sausages
.