It is permitted to make a Beth Midrash (house of learning) out of a Synagogue. However, a Beth Midrash may not be turned into a Synagogue. The reason for this being that the holiness of a Beth Midrash is higher than that of a Synagogue and we have a concept that we can increase holiness but not decrease.
This applies to building a Synagogue that is used exclusively as a house of prayer with no Beth Midrash for Torah study. If, however, the Synagogue which was built in the place of the Beth Midrash will also contain a Yeshibah for the daily study of Torah, it is permitted to make such a Synagogue from a Beth Midrash.
(See Shulhan 'Aruch, 153: 1. Kaf Hahayim ibid Oth 1 and 5)