Several years ago I was wondering what the rules were on this and found the following in the various scriptures and commentaries of Mishnah and Talmud which seem to agree on general principles. It is clear that for a synagogue of a city to which people come from other cities and is not a private synagogue owned by a small group, can not be sold under Jewish law except with the consent of the "entire Jewish world". Which would mean a unanimous vote certainly, but also need to be a unanimous vote of all Jews in the world, or at least all who ever use or might use that Synagogue. There is also the principles that it can not be sold to a person, its sanctity can not be downgraded, and that a replacement Synagogue must be built and completed before the sale. I shared this research but there was little interest.
Exodus 25:8(8) And let them make Me a sanctuary that I may dwell among them.
Mishnah Megillah 3:1
(1) Residents of a town who sold the town square, may purchase a synagogue.... who sold a synagogue, they may purchase an ark in which to house sacred scrolls. If they sold an ark, they may purchase wrapping cloths for the sacred scrolls. If they sold wrapping cloths, they may purchase scrolls of the Prophets and the Writings. If they sold scrolls of the Prophets and Writings, they may purchase a Torah scroll... They may not sell a sacred object belonging to the community to an individual, even if the object will still be used for the same purpose, due to the fact that by doing so they downgrade its degree of sanctity,...
Megillah 26a:6
§ The mishna states: If they sold a synagogue, they may purchase an ark. The Gemara cites a qualification to this halakha: Rabbi Shmuel bar Naḥmani said that Rabbi Yonatan said: They taught this only with regard to a synagogue of a village, which is considered the property of the residents of that village. However, with regard to a synagogue of a city, since people come to it from the outside world, the residents of the city are not able to sell it, because it is considered to be the property of the public at large and does not belong exclusively to the residents of the city.
Rosh on Megillah 4:1:2
...you can only only sell it with the opinion of the entire Jewish world....and the Yerushalmi says that this means that even if all of the people who regularly come to this city agree to sell it, what if there is one person at the edge of the world who felt close to this city, and at one point regularly attended this place and in his mind it is still holy...
Shulchan Arukh, Orach Chayim 153:7
(7) And that which a synagogue can be sold - this applies to [synagogues] of villages where people from other places do not come [to it] - as it was only made for the residents of the villages. And therefore they can sell it; however, the money retains its holiness and they are not permitted to lower them from their holiness.
And that is when the residents of the city sold it without the knowledge of their leaders; the same being true when the seven distinguished men of the city (ie. trustees) sold it not in the presence of the residents of the city.
But if the seven distinguished men of the city agreed to this sale, and they were in the presence of the residents of the city - they are permitted to spend the money for anything they would want. But if the residents of the city explicitly accepted [the authority of another] upon themselves with this sale, then everything they (ie. the authority) do - even if it's an individual - what was done is valid.
Rema: And as long as the seven distinguished men of the city sell it publicly, it is considered to be in the presence of the residents, and they do not need [their consent], to say yes or no (Mordechi).
But [synagogues] of cities, where [people] come to it from other places - even if they (ie. the residents) built it with their own [money] - it may not be sold, unless they made it dependent on the consent of [one] individual, for then the individual can do what he wants with it, with the agreement of the people. And the same applies to all holy objects that were mentioned here - as all of them follow [the laws of] a synagogue.
Rema: [Regarding] an individual who built a synagogue and gave it to the community, its laws are like a synagogue of the community. But if he left any authority in it for himself, there can be no sale of it without the [approval] of the community and his [approval] or that of his heirs' (Or Zarua and Hagahot Ashr"i in Perek B'nai Ha'ir). And all of this refers to when they have another synagogue. But if they have only one synagogue, it is forbidden to sell it, for even to demolish it is forbidden, until they build another (Rabbenu Yerucham 3:5 and Beit Yosef in the name of Ramban). Any holy object that is sold and is permitted to change [it's level of sanctity with the money from the sale] can be sold without announcement, and is not subject to price gouging (any price can be charged for it). But something that cannot be changed to a lower holiness requires an announcement (Rashba Responsum 1004).
Bava Batra 3b:8
§ Rav Ḥisda says: A person may not demolish a synagogue until he first builds another synagogue to take its place. There are those who say that the reason for this halakha is due to potential negligence, lest he fail to build a new structure after the old one has been razed. And there are those who say that the reason for this halakha is due to the disruption of prayer, for in the meantime there will be nowhere to pray.
Arukh HaShulchan, Orach Chaim 153:17
Even in a village you can sell it....and a place people frequent is like a village, as we saw with the synagogue of the bronze workers in Jerusalem, as if it was only a place that was relevant to a specific profession, or a small group of people---then they have the right to sell it themselves. Only a synagogue for the entire city in a place that is frequented by travelers is impossible to sell...