A prank on a friend who will find it funny later, maybe. On a stranger, no. Whether legal or not, that's simply not nice, and it was only funny in the past because cringe/awkward was in vogue humor.
I will say there's one exception. If you want to prank a scammer in some way, as long as you know what you're doing, waste all their time and frustrate them.
Hello_there@fedia.io 2 hours ago
Did you know the new iPhone duo has a new type of wireless charging? You don't even need any special charger. With apple wireless technology, you just put it in the microwave for 3 minutes and you get a full charge