Typically sump pumps drain outdoors. Most jurisdictions require that. Every now and then I see one that does not.
Sometimes they drain into the sanitary sewer. I don't know of any jurisdictions that allow this. Maybe they did in the past.
Sump pumps are not supposed to drain into the sanitary sewer. If everyone did that, during heavy or continued rains, the result might be an overload of the sewer system and general indoor flooding! It's that, or one lucky house that gets the full load from all the others! Bubble, bubble, toil and trouble.
This is one of two sump pumps in this house. They had had a company by to install an indoor drain/sump system because of previous leaking into the house.
Draining this one away from the house in this case would not have been easy. They would have had to cut through a foundation wall and layer of brick on the exterior of that. Then the tubing would have had to be extended around a stair well on the outside in order to drain sufficiently away from the house. Maybe they simply did not want to do that, and plumbed it like this.
In this case, the seller says that this pump was "grandfathered" and allowed to drain into the sanitary system. It could be that the waterproofing company told them it was grandfathered.
I don't know about that.
There is some checking into it even now.
My report stated that the County needed to be asked about such "grandfathering..."
Well, at least they used purple primer!
My recommendation: When you see such an installation, check into it because it may not be allowed and your buyers would be inheriting a possible future problem.