Connecting the wrong pipe to the wrong system is a legal and environmental problem: foul water discharged into a surface water drain ends up in a watercourse untreated, and rainwater in a foul drain overloads treatment works during storms.
You can usually identify them at the chamber: a foul chamber has a benched channel carrying waste and will smell; a surface water chamber typically runs clear and has no benching or a simpler layout.
Misconnections often date from an extension, conservatory or utility room installed without proper drainage design. A dye test or CCTV survey identifies them definitively.