Yes, but only with a foundation designed for the actual ground conditions. Options include excavating and replacing the soft material, spreading the load with a raft, or transferring load to deeper competent ground with piles. The right approach is determined by a site investigation, not by assumption.
Soft ground is not automatically a barrier to building; it is a design problem with well-established solutions. Where soft material is shallow, digging it out and replacing it with engineered fill can be economical. Where it is deeper, a raft may spread the load enough, and where it is deeper still, piling is usually the answer.
The risk with soft ground is differential settlement, where different parts of the building settle by different amounts and the structure cracks. Good design either eliminates the variability or makes the structure stiff enough to tolerate it.