Yes, panic attacks can occur with performance anxiety, also known as stage fright. So when you are performing, giving a speech in front of an audience, or taking a test, you may experience a panic attack if you have performance anxiety.
To prevent panic attacks from occurring, you need to address the performance anxiety. The following video explains how performance anxiety develops, and what you can do to treat it: