In the sense that the uses of both have been about isolating apps from each other. The early fuss about VMs was about increased density -- but only because
hardware used to be the boundary of isolation, meaning lots of idle capacity.
Containers are a cheaper way to isolate, but the point was and still is isolation.
Separate servers -> VMs -> containers. Same song, different instruments.