the Bose noise cancelling in ear plugs already do the processing in a "dongle" which is at the end of the plug that goes into the phone. nothing is stopping Apple/Samsung/whatever to put this piece of hardware into the phone.
and remember the new Beats headphones that are supposed to hook into the Lightning port instead of the audio jack? THIS is the use case right there.
The wireless speakers/headphones and mics supported by typical mobile phones are all bluetooth. As a result, you wouldn't be able to easily (if at all) do noise cancellation for those devices via software.
You could totally do it for wired headphones, though, if you sorted out the mic positioning problem and the processing latency problem! The processing latency issue is the big one, in my opinion. Doing it without dedicated circuitry on your iPhone without the interference of other (system or user-mode) software is gonna be tricky. A pause on the order of 3ms could be big enough to cause audible glitches in the noise cancellation or give you a headache.
And the other stuff is software, which in general is very hard to enforce patents on with torrents etc.
You're certainly not ever going to do noise cancellation over bluetooth.
I bet the headphones could be much cheaper, though. Bose almost certainly wants to monetize their R&D investment and take advantage of their significant marketshare. (There are non-Bose noise cancelling headphones, but I don't see them around often.)