Yes, groups is ideal for that. If the teacher is a set to belong to their groups, then they will also only be notified (if notification has been set) for submissions from students in their groups. Teachers who aren't in a group will get notified for all submissions.
If assignments settings group mode is separate groups, then the group filter will also show on the assignments page. It can be used for forums as well, though often there's benefits in having other groups' contributions visible.
If assignments settings group mode is separate groups, then the group filter will also show on the assignments page. It can be used for forums as well, though often there's benefits in having other groups' contributions visible.