The Harlem Globetrotters are famous for using the gag to the delight of the crowd.
So, why is the confetti bucket funny? Most people will say surprise. But there are plenty of surprising things that would you could put in the bucket that would not result in laughter (e.g., nails, scorpions, dirty syringes).
The gag is funny because it is a benign violation. The theory proposes that humor occurs when a situation is simultaneously seen as wrong, unsettling or threatening (i.e., a violation) and okay, acceptable or safe (i.e., benign) – which occurs when you think that you are going to have a bucket of water thrown on you, but instead you get confetti.