Office pranks are an excellent way to boost morale. If they're harmless and funny, they're the perfect tool to get everyone laughing and provide shared memories to help you bond with your coworkers. Of course, they also can be a form of light bullying if personally directed, like Jim and Dwight on The Office. As a side note, my favorite prank from that show is when Jim pops the exercise ball, or "fitness orb" Dwight has been using instead of a chair. Apparently, they did a bunch of takes where the ball slowly deflated, but used the one that quickly popped it and sent Dwight tumbling to the floor.
But a different category of office prank is one that's used to teach a lesson. Like a story recently shared in r/pettyrevenge, when user u/jinxxedbyu2 exacted revenge on her out-of-line supervisor when she was pregnant. Pregnant ladies get a pass for almost everything, especially hilarious office pranks.