This is a really scary situation, and I've dealt with something similar in my own house. Not exactly feces coming straight out of the tap, but the smell was the same - turned out a storm sewer pipe broke right under the house, and during heavy rain the water would back up against the foundation, then seep into the basement and apparently put pressure on the water main. Had to call in specialists to do excavation work. That's how badly things can get neglected.
The mechanics of this nightmare usually come down to one of these: either a water pipe burst next to the sewer line and they got mixed together underground, or somewhere the pipes were connected wrong - like the basement flooded, backflow happened, and sewage got into the water supply. Sometimes a check valve is broken or was never installed in the first place. It all depends on how neglected the infrastructure is in that particular area. This is deadly dangerous - direct contact with feces can give you hepatitis A, typhoid fever, intestinal infections. Even boiling doesn't always help against some bacteria.
Usually there's more than one party at fault: the management company that didn't maintain the lines, the local authorities that didn't fund repairs, or maybe old mistakes made when the pipes were laid. If this happened in an apartment building, you need to immediately demand a report from the municipal utilities or water authority, document everything, and file a complaint with Rospotrebnadzor. In a private house - you need to get the well or borehole inspected and do a complete overhaul of the system.