It is like whistling in a theater, you just don't do it. People argue that any unnecessary action (a very arguable expression) should be avoided because it could interfere with your performance. Therefore you aren't allowed to tap your foot either. All these movements are reserved strictly to pop musicians and very famous pianists - the latter even becoming more famous because of their special behaviours - like Horowitz, who was known for curling his small fingers or Lang Lang for spending 50% of his energy on excitement.