Rebecca Moss has worked at digital marketing agency Tecmark for just six months, but there’s one thing she knows for sure about her new employer.

“It’s the prankiest office I’ve ever worked at,” said Moss, a campaign manager at the Manchester, UK-based firm. “I’m always thinking, ‘What’s coming next?’”

I thought she was going to go absolutely mad.

Past pranks include some old standards, like swapping wireless keyboards and mice, so when someone started typing, their words appeared on someone else’s screen. There have also been some messy ones, like the time somebody filled a phone receiver with brown gravy.

But perhaps the best of all, Moss said, happened last Christmas. One Tecmark employee had been waiting for a shipment, a dress she’d be wearing to the office holiday party. A colleague intercepted it, carefully opened the parcel, and then sealed it back up with a surprise.

“When she opened it, instead of the posh dress, it was some stinky gym clothes,” Moss recalls. “Her face was an absolute picture. I thought she was going to go absolutely mad.”

In many cases, office pranks are more than just about having a laugh. For instance, Moss said her office morale seems higher after a good prank, and that because of the jokester spirit, people generally get along better — not to mention that it’s more fun to show up to work when you don’t know what joke is next.

Jokes ought to be something that everyone can find funny.

Of course, pranks can go horribly wrong, too. And that’s especially true on the most fool-hardy day of the year: April Fool’s Day. The key is to know how far you can go without getting fired.

What to avoid

Before you start planning your April Fool’s gag, you should know they go wrong more than right, with the danger of someone in the office feeling like a victim of a bully, said Michael Segalla, professor of management and human resources at HEC Paris business school. Pranks can also make an office seem like nobody’s in charge.

Pranks often target a person, sometimes the under-performer or the office veteran with the top track record. Done wrong, the office hoax is used to “knock someone down a peg,” Segalla warned. In that case, “Pranks in the office are often a bad sign,” he said.  

One big rule of thumb: Jokes ought to be something that everyone can find funny – and something that won’t end up in an HR department file. “It’s not just a matter of whether you’re having fun in the workplace,” Segalla said. “It’s a matter of how you can have fun responsibly in the workplace.”

The trick to staying out of trouble is simple: don’t make someone the victim of your prank.

And above all, the trick to staying out of trouble is simple: don’t make one individual the victim of your prank, Segalla said. If there’s only one person in your group who will walk away with hair full of brown gravy after answering their phone, you likely crossed the line.

Targeting the boss

Matthew Mercuri came up with a legendary prank in his office, the Montreal steam cleaning company Dupray Inc. The CEO and co-owner Sébastien Dupéré was in Germany on business when Mercuri talked his officemates into an elaborate hoax.

There’s a ping-pong table in the Dupray office, and nobody is more serious about it than Dupéré, who has a pricey custom racquet. It’s strictly off-limits to everyone else. “He’s a very nice and genuine guy, but just don’t mess with his ping-pong racquet,” Mercuri said.

So the office sent Dupéré a video of his racquet, laying in the carpark. A car backs up, and the racquet crunches into a pieces. Then everyone ignored Dupéré’s phone calls and emails for a full day, letting the prank sink in.

Finally, Mercuri came clean that the video featured some fancy editing. Before the car rolled over the racket, it was swapped out for a cheap one. Dupéré’s prized racket was safe.

It was a bonding experience that’s still laughed about seven months later.

The key to staying employed after this hoax? The team had the blessing of the company’s other two owners before pulling their prank. Afterward, it was a bonding experience that’s still laughed about seven months later around the ping-pong table.

Not everything has changed, though: “He still doesn’t let us touch his racquet,” Mercuri said.

When a prank goes wrong

David Hellard learned about crossing the line with an office prank in 2000, when he was working as a temporary hire in the finance department of King Alfred’s College, now called University of Winchester in Hampshire, UK.

A bit bored one day, Hellard left a note on the printer: “Shut down imminent, 10 days until total deactivation.” Every day, he printed out a new note, with one day less in the countdown.

“No one really mentioned it, so I just kept carrying on,” Hellard recalled.

On the final day, Hellard noticed a gaggle of upper management types near the printer. With them was a technician from Xerox, flown in from the US to try to figure out the strange message. Hellard had to confess.

Upper management felt like fools, as did the printer technicians. They all laughed, but Hellard thinks everyone was quite embarrassed by being spoofed.

You certainly have to choose your moments wisely.

“By explaining what had happened, it made everyone look gullible, which really wasn’t my intention. It was really pretty cringe-worthy on all accounts,” he said.

Now, Hellard is director of sales and marketing at ZipCube, the London company he helped found that rents out meeting rooms. He’s learned from his early prank.

“I’ve always been a prankster and always will be,” he said. “But you certainly have to choose your moments wisely.”

The wood glue backfire

That’s especially true if you’re the forgetful type.

Candice Galek thought she had picked a simple gag to pull on the employees of her Miami bathing suit retailer Bikini Luxe. One day, on a lark, she filled the bathroom soap dispensers with wood glue.

She got busy, and hours went by. Then she went to the bathroom herself. Forgetting what she had done, she filled her own hands with wood glue. “I got so wrapped up in everything that I just totally forgot,” she said.

The worst part of getting caught in her own prank, however, was when she turned the tap. Work was being done on the building, and the water had been shut off.

If you can laugh at yourself, then your employees know they can laugh with you.

“I had to smear my hands on towels and try to get it off with water bottles,” she said.

But Galek said the frequent pranks in her office bring people together. Everyone shared a laugh about her gluing her own hands, and that made her and her 40 employees a bit closer.

“It goes to what kind of relationship you have with your employees,” Galek said of office pranks. “If you can laugh at yourself, then your employees know they can laugh with you.”

To comment on this story or anything else you have seen on BBC Capital, please head over to our Facebook page or message us on Twitter.