Use macbook to cancel ambient noise
In short, no.
The measurement required to provide correct phase-cancellation in a headset is measured in microns, not inches.
You could neither measure it accurately enough nor stay still enough for it to work.
You would also suffer so much throughput latency in hard & software that any attempt at correction would arrive far too late to be of any use.
Some people seem to object to my definition of the precision required for this to be effective.
Let's add more to that.
Not only do you need your distances to be accurate for the gap between mic & speaker, but you also need to be feeding the resultant audio back at the correct phase with regard to the speaker/mic orientation.
If you are trying to do this using a mic oriented at approximately 90° to the headphone speakers, assuming you are facing the computer, your chances of success are even smaller.
You then need to decide which phase you are going to send to which ear. Are you going to guess at an approximation of the 90° & then flip one by 180° compared to the other?
Does that better explain why these systems are measured in microns, not inches? It has little to do with the wavelength at any given frequency & more to do with the orientation of your phase... otherwise you are just as likely to reinforce the wave as to cancel it.
I guess that won't work for the simple reason that the lag between microphone and headphones is simply too long to cancel a noise before you hear it.
If you use google translate, this article explains the issues in a bit more detail : https://www.heise.de/ct/hotline/PC-Beruhigung-mit-Antischall-319834.html
What kind of works is cancelling a constant noise through a normal headset by calculating and then manually adjusting the phase of the Gegenschall.
As much as they would like you to believe it Apple is not capable of violating the laws of physics.
Noise cancellation works because the relative positions between the speaker, ear and microphone are precisely known. When you have cord between your headphones and microphone (laptop) you no longer know the relative positions.
Mac OS is not a real time operating system, it is unlikely that it could do it even if you could bolt your head to your laptop.