Yes, anxiety can affect your functioning at school. How it affects your school performance depends on how what type of anxiety you have.
If you have generalized anxiety disorder (GAD), then you will have constant worries about how you are doing in school, worry about failing grades, worry about having friends, etc. These constant worries lead to headaches, muscle tension, sleep problems, irritability, and poor concentration. So your school performance suffers as a result.
If you have social phobia or social anxiety disorder (SAD), then you will have a fear of social scrutiny when you are in groups of people. So this might affect your ability to make new friends at school, and it will affect your ability to enter classrooms with lots of people. You may even get so anxious about crowds of people that you avoid school altogether, or call in sick alot.
If you have a performance anxiety, like test anxiety, then you will experience anxiety attacks every time you take a test. Your school performance will definitely be affected if you have a performance anxiety like test anxiety.
If you have a specific phobia, which is a fear of an object (fear of spiders) or a fear of a situation (fear of heights), then you would only have a problem at school if you have a specific phobia that you would encounter at school. So if you have arachnophobia and there a lot of spiders at school, or if you have a fear of heights and your classroom is in a tall building, then your school performance would suffer.
If you have panic disorder, then you might get panic attacks at school. Soon, you would have anticipatory anxiety about having another panic attack. Then it might progress and you have a fear of places (ie school) where you might have a panic attack or from which escape might be difficult- this is known as agoraphobia. If you have panic disorder, and if you also have agoraphobia, then your school performance would be affected.
If you have separation anxiety from your parents, then your school performance would be affected as you would not want to go to school as you fear a separation from your parents, or you believe something bad would happen to them if they were away from you.
If you have PTSD (post traumatic stress disorder), then your school performance may be affected, especially if you have flashbacks at school about the traumatizing event. If you have nightmares, then your disrupted sleep would affect your school performance. And if you had the trauma at school, then this would definitely affect your school performance.
If you have OCD (obsessive compulsive disorder), then your school performance would be affected if your obsessions and compulsions occurred at school.
As illustrated above, anxiety in its different forms can negatively affect your school performance.