It depends on why they've come and what they say. If we don't know who they are, but they say that they're at risk of persecution if we send them back to where they came from, then we have an obligation under the United Nations refugee convention to consider if their fear is valid or not before we send them back. We don't want to be complicit in sending someone back to be tortured.
If they just say they want to come to visit, they get routinely turned around if we're not satisfied as to who they are. Once they make claims of persecution, we have to adjudicate those before we send them back.