The origin of masonry heaters goes back 2 - 4,000 years depending on what you read. In Afghanistan, they had the "Tawakhaneh", China the "K'ang", Korea the "Ondol" and the Romans had the "Hypocaust". Who was first? Probably Afghanistan, but the answer is unclear. However, all were based on similar principles.
The smoke and heat from the fire was drawn into channels that then went through a series of ducts under the masonry floor. This absorbed the heat and radiated it into the room. The smoke escaped from the end of the channel. The Afghans could close the channel to retain the heat once the cooking fire had finished. This doesn't appear to be the case with the others.
In Europe, masonry heaters emerged in the 1500s in response to the energy crisis. There was a shortage of wood (the main fuel used) in towns. Because so many forests had been removed near towns to meet the needs of the growing populations, wood had to be brought from further afield. Not only was it harder to obtain, wood was also expensive.
Then there was also the Little Ice Age from about 1550 to 1850 - a period of extreme cold. Death from cold was very real. Unsurprisingly, the first patents for wood-conserving stoves came during this period and rulers across northern Europe sponsored competitions for better stove designs. From this, emerged the masonry heaters we have today with channels that capture the heat from the gases before they escape the heater. The other element, high temperatures to burn the gases in the wood, emerged more slowly.
As a result, the principle behind all masonry heaters is pretty much the same: a hot, fast fire to maximise efficiency with the gases travelling through a length of channels that extract the heat before it leaves your home. But the specific design is different depending on where it originated.
The best source of more information is probably David Lyle's "The Book of Masonry Stoves. Rediscovering the old ways of warming".