For our new building, the architect "proposed" this by marking it in the plans. With direct discussions with the head of the civil engineering office (a very nice person in our case) after submitting the documents, he can also give an oral statement whether he agrees with it.
The contract is usually awarded to a company. In our case, that company in turn employed subcontractors. And they did whatever they wanted or, to be honest, they did not recognize the boundary line on site and estimated it to the best of their knowledge and belief, but made a mistake of 2 meters distance from the house. Instead of running straight from the street to the house connection, the pipes on our property now run around corners parallel to the street and only then go into the house. This will be re-routed again in about a year, but the old pipes will simply remain as trash in the ground (on our property) --> tough luck for me.
How could this have been prevented? The executing company should have had someone with knowledge on site to check it. Someone from us could have been on site and pointed this out early. The boundary marking, partially obscured by the crane, could have been made more noticeable again for the house connections (e.g. with spray paint on the gravel). But you never know about mistakes beforehand.