Yes, this is what I used to do with REAPER (a digital audio workstation tool). It was even able to do this in soft real time (that's how I recorded my more recent courses) with only 10ms of delay.
But from my understanding it does this by dampening or removing (depending on how aggressive you have it configured) the frequencies of your room or whatever sound you're trying to remove.
A relatively low volume fan hum is pretty easy to remove without distorting the target audio, but if the frequencies start to overlap with varying degrees of volume the whole thing becomes a jumbled mess.
To put this into perspective, the video at the top of https://diveintodocker.com/ used REAPER's noise reduction plugin to remove a pretty loud tower and power supply fan. Even with studio grade headphones at max volume you probably won't notice a hint of hissing or white noise when I'm not speaking, but if you have a trained ear there's a subtle clamping down on the lower end of my voice's range. 99.9999% of people won't notice it, but this is also a best case scenario for removing frequencies (a constant low hum at relatively low volume) that rarely interweaves with my voice's frequency. The whole game changes with multiple instruments and volumes that cut across your range.
Even outside the scope of removing copyright material there's a lot of interesting use cases, like being able to split vocals or instruments from any track so you can practice layering in your own music as a musician (such as playing your own guitar solo over an existing song).
A known song could be used as a time-series with a similar effect.