When we do a floor replacement in apartments in Manhattan that have the original floors, we typically need to remove all the base molding as the existing floor runs underneath it. See Figure 1 to the left for a diagram of what this typical floor setup looks like. We've been asked whether we could leave it in place and cut the edge of the floor, but unless it's very unique or expensive molding, it almost always makes the most sense from a cost-effectiveness standpoint to remove the base molding.
Occasionally we'll salvage base molding, but between taking extra care when pulling it off, labelling, cutting/bending back old nails and scraping off the old caulking, simply removing and discarding the old base molding and replacing it with new molding makes more sense. We also typically work in apartments where the entire floor is being replaced which leaves us very little room to maneuver and having to shift around 150-250 linear feet of base molding during an installation can also add to the price.
If your floor runs next to your molding and there is a shoe molding covering the expansion joint - space left between wall and floor to allow for expansion and contraction of the wood floor - then just pulling out the shoe molding and replacing the shoe is fine. The base molding could stay in place for the duration of the project wouldn't need to be removed. See Figure 2 for a diagram of this setup.
There are always additional details and exceptions to the rules, but this covers about 85-90% of the base and shoe molding setups that we see when we're asked to come in and replace a floor.