As a parent who would likely chaperone younger children on a Trick or Treat outing, I personally would not like it if my child were chased by a random or costumed adult (or kids) on the street with the intent to scare them. And I KNOW my children wouldn't like it if a stranger did this them randomly on the street versus if we went through a haunted house with the expectation of seeing something scary.
Despite it being Halloween and all, there is just know way of knowing if you were a crazy person or a neighbor just having fun. And often people trick or treat in neighborhoods that aren't their own, so there is a good chance anyone you would scare on the street, probably won't know who you are. And that means when it comes to how they deal with it, or you, it's anything goes. You might get assaulted by an over protective parent or cause a frightened child to run off into traffic or get hurt if they over-react.
I don't think having a haunted graveyard in your backyard for kids and families to walk through or a haunted house in your garage would be bad. People where I live do stuff like that all the time...and free of charge. They'll have people walk through and give away candy at the end. Never heard of any problems and it seems everyone who chooses to participate enjoys it...but I think it helps when the trick or treaters can choose for themselves if they want to take a chance on being scared.
As for springing it on people on the sidewalks or out and about, I'd say probably not a good idea. Also don't have people come and go into your actual home if you do a haunted house. You could get cased and robbed, and I as a parent would never let my child go into a home we didn't know. A garage with people streaming in and out of it is about it...and I'd want to be able to go through with them.