Somewhat. Sealing air leaks cuts outdoor noise that sneaks in through gaps, and open-cell foam absorbs some sound inside a wall. Neither type stops footsteps or bass, which need added mass and a structural break rather than insulation.
More detail
Much of what you hear from outside arrives through air paths, not through solid wall: gaps at window frames, the attic floor, mail slots, and the band joist. Sealing those makes a noticeable difference in houses near I-670, I-270, SR-315, or the rail lines that cross the city, and in older houses along High Street and Broad Street. Inside a wall, open-cell foam, mineral wool, and cellulose all soak up some airborne sound; closed-cell is stiffer and less useful acoustically. Low-frequency and impact noise, such as footsteps overhead in a Short North condo or a home theater in a Dublin basement, travels through the framing and needs mass, like a second layer of drywall with a damping compound, and decoupling, like resilient channel or isolation clips. Foam alone will not deliver a quiet room in those cases. For a bedroom wall, open-cell or mineral wool plus sealed outlet boxes is a reasonable, modest upgrade.