@Jack B Nimble's answer gives an excellent explanation of what happens in the book. The thing is that the same exact thing happens in the Ridley Scott's film adaptation.
In the first image we see the internal structure of the Airlock 1. After awhile, we are shown how it starts de-pressurising; however, it is not the airlock itself, but its juncture with the HAB. Just after that, we see the whole airlock structure being completely de-attached and ejected from the HAB.
One has to admit, though, that the scene is definitely fast-paced and a bit misleading, which is why you might have thought that the air was coming from Mars' atmosphere.