When I was about 10 years old I had a teacher who was very strict and unfriendly. I combated it by being nasty back to her, didn't get through much music in between these power struggles.
I have never shouted or yelled uncontrollably at any student. When you do it highlights that you are personally involved and frustrated. A weak teacher gets frustrated and annoyed because they cannot solve the students problem which might seem so easy and obvious to themselves.
However if through their aggressive approach you find you are learning something, or feel like you are put to the test, constantly pressured by the teacher to produce results, then this might be good. However you do not feel like the teacher is being bad mannered rather a force for motivation, a force to encourage you. If it is just useless yelling and it highlights only the teacher letting off steam, then you should dump the teacher immediately.
If through their yelling they are encouraging you, driving you on, then it is good and you should toughen up and not be such a baby! Certainly learning the piano can be frustrating, a good teacher can highlight your frustrations through their own tone of voice and choice of words, sometimes their yelling mocks your own annoyance and drives you to improve yourself. I have one Chinese boy I teach who we have yelling and shouting. But it is not uncontrolled, he knows we are both not angry and we both are excited about the music and that this yelling and poking fun at his mistakes actually makes the lesson more enjoyable for him. But not everyone is like this, most people like a soft approach, as the saynig goes; "Honey catches more flies than vinegar." but there are rare cases where students like the vinegar! These lessons can be very interesting so long both parties know each other are not in an uncontrolled bad mood.
I find people sometimes do not understand the difference between controlled and uncontrolled negative emotions. It is perfectly fine to be angry with someone and show it to them, but in a controlled manner. It is fine to be sad, scared etc, but so long it is controlled. These controlled negative emotions can in fact encourage us to do better, push us on, however the uncontrolled versions hinder and demoralize us. Some teachers who have very good controlled negative emotion however do not spend enough time to ensure that their students pick up on this controlled emotion. This then makes the student close up and become less responsive.
In fact it is sometimes good to ruffle the students feathers a little. I have, to new students, acted really strange to them, to break the ice, to make them feel more real with me, not pretending to feel a certain way, put on a mask of obedience. I like to see the student for who they really are, and sometimes you can encourage that out of them by poking fun at them, but of course the teacher has to be very careful using this, you can't over step the line, but if you get it right it can certainly melt away a students emotional defenses when they have lessons with you. This can be important in many different ways but most importantly it keeps each party honest. Often a student can pretend to know what you are talking about to appear acceptable to the teachers eyes, this is a damaging circle to allow into your lessons.