From a web page titled "The Synagogue":
Generally, any Jewish male could lead a prayer or read and translate Scripture. Every service began with specific readings that had been prescribed by the scribes and rabbis. Most commonly read was the shema (“hear”) passage (Deut. 6:4-9). Nearly every service gave much attention to reading sections from the Law, the Prophets, and especially the Psalms. The congregation would stand as Scripture was read (cf. Neh. 8:1-8), and the reader was forbidden to take his eyes off the scroll in order to ensure that the word of God was communicated accurately (cf. Luke 4:16-20). Following a reading, a male in the synagogue (usually prepared in advance) would seek to apply the Scripture to life in the form of a brief sermon. Visiting rabbis were frequently asked to bring sermons to local synagogues (see Acts 13:15ff.).
In addition to a worship location, the synagogue also served other functions in a community. It was a school for training Jewish children in the Laws and ways of the Lord. It was not uncommon in the first century to find young children hard at work in synagogues memorizing the Torah, or Law of Moses. The synagogue also served as something of a community center for festivals, times of mourning and fasting, and as a center for feeding strangers and the poor. Sometimes the synagogue functioned as a court of law in which important questions regarding God’s law were decided. People could be banned from the synagogue (Jn. 9:22; 12:42), and sometimes corporal punishment (administered by the hazzan) could be applied for rebellion against the authorities — usually 39 lashes to honor God’s commandment (cf. Deut. 25:3).
I don't know, but Jesus and his Jewish apostles could have preached during the sermon time. Or, they could have spoken while people were gathered for school or community activities.