A church is the House of God, so no, you cannot ban anyone from entering.
You can expect them to respect what is going on if there is a service of any kind in progress. If they don't the parson or priest officiating needs to find some tactful way of dealing with the matter.
I once sat through a sermon enlivened by a very drunk man who wanted to discuss every second point the parson made.
After listening and answering politely for a while, the parson said, "Please, go and sit down again. Let me finish my sermon and the service, and then we can go into my study and continue our discussion."
The drunk complied and fell asleep before the service ended.