This is an interesting question that requires a couple of different fields of study to explain.
Firstly, we are able to smell through special cells in our nose that detect particles nearby. Essentially, when molecules of the pie reach our nose on earth (basically "gas" from our pie), these cells send a message to our brain that describes the smell. Queensland University has a great article you can google that will tell you a bit more if you're interested in the details.
Secondly, whenever you put anything into vacuum (aka an "airless" box), it begins to outgas. This means that if I load a freshly baked pie into a vacuum chamber, the pressure of that chamber will start to slightly rise as gas (which holds the smell) starts leaving the pie. This gas spreads by the principle of diffusion, basically implying the gas will spread as evenly throughout the chamber as possible. Try dropping a bit of food coloring into a glass of water if you want a visual demo
So, if we had a "robotic nose" that could detect smells, and we placed both it and a baked pie in a small enough vacuum chamber, we could probably detect the smell of the pie, as the "air" needed to smell the pie would have been created by the pie itself. If we instead put both the nose and pie in space, then the chances of the nose measuring any smell goes down drastically, as the "chamber" here is much, much larger meaning the gas has much farther to travel to reach our nose