It seems like every account of things like woodstoves and masonry heaters being invented mention that they were made in response to fuel shortages. There were fuel shortages in Medieval times and antiquity though as well, why didn't anyone think to build masonry heaters and chimneys and whatnot? Like, during the Edo period, Japan was obsessively managing their forests, but people were still using massively inefficient charcoal braziers in their kotatsus. While the mediterranean was being deforested, Romans were still cooking and warming themselves over open fires, even though they clearly knew about chimneys and stuff, because they used them industrially. Why didn't the high price of fuel ever make more efficient means of heating economically viable? Or was it just that nobody thought to do it?
massively inefficient charcoal braziers
Charcoal braziers, and also open fires on hearths, are efficient building/room heaters, and can be more efficient than stoves such as iron woodstoves and masonry heaters. "Advanced" heaters will typically outperform them in terms of "combustion efficiency", which is essentially a measure of how completely the fuel is burned. The higher temperatures usually obtained with stoves mean that their combustion efficiency is higher, but this comes at the cost of "transfer efficiency" - heat is lost to outside the building due to the flue gasses. When heating an indoor space with a simple open fire, or a brazier, or other similar methods, all of the hot gas produced by the fire stay within the room.
This high efficiency of open fires etc. for indoor heating is probably a major reason why home chimneys took so long to become common (are in some parts of the world with cold winters, are still not common). Such open fires do have disadvantages. First, they are polluting - this is a result of all of the combustion products staying in the building/room, made worse by the lower combustion efficiency. While traditional buildings appear to have enough ventilation (even when closed) to avoid acute carbon monoxide poisoning, long-term exposure to smoke etc. can, and often does, result in health problems. For more on this, see my past answer in:
The pollution problem is reduced by using charcoal, but if the efficiency of traditional charcoal-making is included, it is far less efficient as a fuel that wood. Simple chimney-less charcoal stoves like
will provide further improvement in combustion efficiency.
Second, an indoor open fire is limited in size - a blazing bonfire indoors (with no chimney) could easily be a serious fire hazard, and can easily result in fatal carbon monoxide poisoning. The solution to this is to provide ventilation - the classic long-term method is a chimney. If ventilation (whether via a chimney or otherwise) is provided to allow a large fire, then the efficiency falls greatly, due to heat lost through ventilation. The open fire might have had a total efficiency of about 80% (about 80% combustion efficiency and almost-100% transfer efficiency), while a simple fireplace with a chimney might have an efficiency of about 10-20%. If about 6 times as much is burned in the fireplace, it will provide as much warmth as the original open fire, with less indoor air pollution. If fuel is cheap enough (or the owner rich enough), this can be a worthwhile tradeoff. If even more fuel is burned, the fireplace can provide heating beyond that safely possible with the open fire.
To return to "advanced stoves", note that with simple designs, higher combustion efficiency typically results in lower transfer efficiency. Improved combustion efficiency results from high combustion temperatures, but this producing hotter gasses, and with simple designs, this means that the flue gasses are hotter, and therefore carry more wasted heat. To improve the transfer efficiency, a longer path can be used for the flue gasses, to give them more time to transfer more heat to the building/room. This is an important part of the efficiency of a contraflow masonry heater - the hot gas from the fire travels a back-and-forth path, providing a longer distance and more time for heat to pass from it to the body of the heater. When the flue gasses finally exit, they are fairly cool, and only carry away a modest amount of heat. Such a heater has similar efficiency to an indoor open fire, about 80% (a higher combustion efficiency, and a slightly lower but still high transfer efficiency), but can provide more warmth safely, with minimal indoor air pollution.
Such masonry heaters are relatively recent, appearing in northern Europe in the 16th century. However, similar heating systems were used earlier in East Asia, such as the Korean ondol under-floor heating system and the Chinese kang "bed-stove". These achieve the time needed for the flue gasses to transfer their heat to the heating system by directing the gasses from the fire into a relatively large space, which results in a much lower speed of the gasses. Also, the distance the gasses travel is quite long - with the Korean ondol, if it is used to heat multiple rooms, the distance travelled is the combined length of all of those rooms. (The contraflow masonry heater uses a series of baffles to achieve a sufficient distance in a relatively compact package.) These East Asian heating systems appear to have been developed in the 1st millennium BC. Of similar antiquity are similar heating systems in the Mediterranean region and western Asia (e.g., the Roman hypocaust).
Large heating systems like these, both ancient and modern, aren't free. They can add significantly to the cost (whether in money or labour) of building a house, and they take up space. Materials such as stone, brick, and tile might need to be purchased. The system is not portable, so if the house is expected to only be used for a short time, it isn't suitable. Unlike a brazier, it can't be carried around by nomads. Since similar fuel efficiency for heating can be obtained by an open fire or simple stove, we should expect to see them in pre-modern times mainly in very cold areas (where the limited size of an indoor open fire might not provide enough warmth) or in the homes of the rich.
Efficiency in cooking will generally be lower. Heat carried away by the combustion gasses is lost heat. Heat that warms the floor, the wall, or the body of the stove is lost heat. Simple chimney-less stoves like the charcoal stove linked above, or similar stoves for other fuels, can provide higher combustion efficiencies due to higher temperatures, and force the hot gasses past the cooking vessel, allowing more heat to be transferred for cooking. Efficiencies of about 20-25% are typical good efficiencies. Generally the more enclosed the space where the fuel burns, the greater the possible efficiency. However, enclosure of the combustion space can be limited by the type of fuel. For example, if lengths of wood more than 30cm are used, and the combustion space is about 15cm is size, there must be a large enough opening for the wood to stick out:
The indoor pollution produced by a simple stove like this can be greatly reduced by using a chimney. However, when a chimney is used, more of the hot combustion gasses bypass the cooking vessel, and the heat carried by them is lost. Thus, lower efficiency is a cost of reducing the indoor pollution (however, the reduction in efficiency is much less than that when going from an indoor chimney-less fire to a fireplace with a chimney). More "advanced" stoves can be larger, reducing the efficiency by required more energy to heat the body of the stove. Thus, with things like these tending to reduce the efficiency of more "advanced" supposedly-efficient stoves, these stoves are often less efficient than a simple chimney-less stove or an open fire. Such reduced efficiency, reduced portability, and greater cost have limited the adoption of such stoves. Where indoor air pollution from chimney-less stove is considered a large enough problem, they might be adopted, or if wealth allows, a modern butane stove (or other gas stove) might be used.
Finally, some fuels cost more than others. For example, charcoal needs to be purchased, or at least made (which requires labour and wood as fuel). Coal needs to be purchased. In urban areas, most solid fuels might need to be purchased, but outside towns, fuel might be available for little cost (including labour). For example, if there is rice straw surplus to what is needed for fodder, mulching, bedding, and thatching, it is free fuel that needs to be cleared from the fields. Similar, dung beyond what is needed for fertiliser, plastering floors and/or walls, etc. is free fuel. As noted above, some stoves use less efficient designs in order to give more flexibility in the fuels used.