That's an interesting question. The reason why nitrous oxide is used as a propellant is that it dissolves in the liquid cream. When the cream escapes from the can, the gas expands and in doing so whips the cream into a foam. (This explanation is from the book "Food Science".)
Now, the interesting part is that nitrous oxide is an inhalation anesthetic because it dissolves in synaptic lipid membranes. So it's not a coincidence that nitrous oxide is a whipped cream propellant and an inhalation anesthetic: nitrous oxide dissolves in fatty cream and it also dissolves in fatty cell membranes.
Lots of things work as inhalation anesthetics; the better they dissolve in the lipid membranes, the lower the pressure required. This is why spot removers like ether and chloroform work as anesthetics in low concentration. At high enough pressure, even nitrogen will dissolve in membranes; this causes nitrogen narcosis in divers. Even an inert gas like argon will work as an anesthetic since it will dissolve in membranes under enough pressure. This is also why people sniff fat-soluble gases like propane and freon to get high.
"The basic principle that lipid solubility of anesthetics governs anesthetic action remains viable. Specifically, the narcotic action of a drug correlates strongly with its solubility in biologic membranes. Interactions of anesthetics with biologic membranes cause expansion of the membrane. Membrane expansion by a critical volume of 0.4 per cent results in anesthesia. Evidence is available to show that anesthetics selectively combine with hydrophobic groups in biologic proteins, whether purified or membrane-associated. Perhaps these alterations in membrane structure affect synaptic transmission in the brain, giving rise to anesthesia."
Another possible method is changes in membrane protein structure altering ion flow. Action on membranes in mitochondria and endoplasmic reticulum might also be responsible.
The primary anesthetic action seems to be the synapse. Anesthetics may alter the binding of neurotransmitter to specific receptor proteins. The section concludes that the mechanisms are not necessarily exclusive of one another. Multiple mechanisms may be responsible for anesthesia.