What happened in the synagogue in Capernaum that the people in Nazareth had heard about in Luke 4:31-37?
Luke does not actually tell us what Jesus did in Capernaum that the people in Nazareth had heard about. He says that Jesus went to Capernaum after being driven out of Nazareth. However, in Mark 1, we are told about what Jesus did in Capernaum. It is fairly similar to what Jesus does in Capernaum in Luke 4.
Basically, Jesus drives a demon out of a man in Capernaum. In Mark 1, when Jesus preaches in the synagogue in Capernaum, an impure spirit is inside a man and it asks Jesus why he has come to destroy “us.” It then claims that it knows that he is the Son of God. Jesus tells the demon to be quiet and to come out of the man. It obeys and leaves the man.
In Mark, at least, this is Jesus’s first miracle and it makes him famous in the region.