All perfect praise be to Allah The Lord of the Worlds and may His peace and blessings be upon our Prophet Mohammad and upon all his family and companions.
There is no harm in placing a heater in front of the people praying in a Masjid. This is because there is no Sharia text that says otherwise and, in principle, this is permissible, and we can`t rule that it isn`t save with an evidence from Sharia. Although some Maliki and Hanabali jurists say that praying against fire is Makruh (Reprehensible) because it involves imitating the Magi who worship fire, this proof doesn`t hold water since, nowadays, it is highly unlikely that such an idea would cross the mind of any Muslim. We may add that there is a huge difference between the worship of the Muslims and the Magi, and this suffices to exclude this assumption.
At present, Muslims wouldn`t have the intention to imitate the Magi in any religious or worldly matter. In fact, we haven`t found any opinion for the Shafie jurists on this particular issue. However, the eminent Hanafi scholar Ibn Abdeen cited an excerpt proving that it is permissible to place a heater in front of the praying people, because the Magi worship the fire inflamed with blazing coal and not any other fire. Whereas, the heaters used in Masjids are run by gas and not coal.
It was reported that some of the Hanafi jurists said: "It isn`t reprehensible to pray against candle, lamp or fire, because the Magi worship the blazing coal, not the fire. It was stated in the book {Al-Qhonya/ chapter of reprehensibility}: "The correct opinion is that it isn`t reprehensible to pray against lighted candle or lamp because nobody had ever worshipped them, and the Magi worship the blazing coal, not the fire." {Raad Al-Mohtaar-vol1/pp.652-by Ibn Abdeen}.
Overall, it isn`t reprehensible, nowadays, to pray facing a heater in a Masjid, because there is no solid evidence proving otherwise, and reprehensibility is a legal ruling that doesn`t hold water save with proof. And Allah Knows Best.