How to make a dolly effect?
The "Vertigo effect" is achieved by zooming in while tracking out, or zooming out while tracking in. When done right the size of the subject stays the same in frame, while the perspective shifts unnaturally, giving an uncanny feel to the footage.

The effect is achieved in-camera. It could be replicated in post by separating the planes of the image along the depth axis and replicating the real-world camera movement, but it would be highly labour intensive, compared to doing it on set.

P.S. Just to be suuuper pedantic, a "dolly" is a sideways movement, a movement forward or backward is a "track".