pepper contains basically piperine. Piperine acts as an irritant if it gets into the nose. It irritates the nerve endings inside the mucous membrane. This is what causes you to sneeze. Actually, the nose wants to kick out this irritant and the only way it knows how to do this is by sneezing.