"...so scolding a child has the opposite effect."
I wouldn't say so... It's depends how the child feel, if s/he feel guilty, so s/he won't do it again, but if s/he don't feel s/he did something wrong, then s/he won't afraid to do it again.
It depends what you teach your child, and if you correct explain him or her the situation, so s/he will understand that the thing s/he do is not right.
If taking the prank situation then of course scolding won't help lol, he probably knew it might happen, so just got ready for the scolding before doing the prank.
LoL People who suffer pranks will usually get angry and will scold...