It should be clear that if the room was present already and the masjid was then built on top of it. And after the expansion of room the masjid was also expanded by including the additional space created. Then it is permissible to offer salath in this masjid and expansion is considered as possible. However, if the land was initially dedicated for the masjid and a a proper masjid was created then it cannot be changed. infact, the rules of masjid will be applied on the land till Qyamat
Allah knows best
Darulifta Al Ikhlas, Karachi