Wherever foam must bond to the surface it seals, yes. Roof decks, rim joists, and knee walls need clean, dry, bare wood. Old attic floor insulation can sometimes stay when the floor is being air-sealed and topped up rather than foamed.
More detail
Foam works by bonding to wood, masonry, or metal and sealing gaps as it expands, so anything between the gun and the surface defeats it. Batts come out of rafter bays before a roof deck is sprayed, and the fiberglass stuffed into a basement band joist comes out before closed-cell goes on. Anything wet, moldy, soiled by mice, or smelling of smoke should come out no matter what replaces it. Many Central Ohio attics from the 1940s through the 1970s hold layers added over decades, such as loose cellulose over rock wool over the occasional pocket of vermiculite. Vermiculite is the exception to casual removal: if you see gray-brown or gold pebbly granules, stop and read the asbestos and vermiculite FAQ before anyone disturbs them. Removal should appear as its own line on a proper quote, and it is often done the day before spraying so the crew starts on a clean surface.