The common name for ringing someone's doorbell and then running away is Ding Dong Ditch.
Ding dong ditching is where someone "typically kids" but sometimes adults play a prank on someone by going up to their doors and ringing the doorbell and then immediately running away.
Some people just brush it off while other people may call the cops and report you and if caught you can get into trouble for ding dong ditching.
So I would advise to never do it even though it may seem like fun.
A person caught ding dong ditching may face some fines and have to do community service and if it happens again the Juvenile may be arrested and have to serve a few months in Juvenile detention which is never fun.