They are not equivalent. "On the way" means that the location or object is along, adjacent to, or near some route.
If we're going to John's house, can we stop by the store to pick up some snacks? It's on the way.
"In the way" means that the location or object is directly in the path or blocking that route.
You used to be able to see the ocean from that hotel, but recently they built a larger hotel that's in the way.
Another way to think about it is that something "on the way" is convenient, while something "in the way" is an obstruction. It's possible to have both in the same sentence:
On the way to Lauren's house out in the country, we were delayed by a herd of cows that were in the way.
Moreover, "on the way" only really makes sense when talking about something related to people, or other entities that have the ability for conscious choice, even if it's only to specify some point of interest.
The restaurant is on the way to our hotel, if you want to stop for a quick bite.
"Fire" would not qualify, as it is mindless. A fire would not stop at a corner store to pick up a bag of chips (a.k.a. crisps) on its way to burn a town. Instead it might burn down the store, if it was in the way, which is what you should use in this case:
The fire consumed everything in its way.
I can't think of any case where you can freely substitute one for the other without changing the meaning.
(Edit) In the case where you're talking about a conscious entity acting as a destructive force (such as an army), which you use depends on what you want to say. For example, if you want to imply the army was engaged in wanton destruction then, as with fire, "in the way" makes more sense.
During the march south, the Union army indiscriminately torched any towns that were in the way.
On the other hand, if you want to imply the army was consciously selecting targets for destruction, then "on the way" would work:
During the march south, the Union army deliberately torched railways, supply caches, farms, factories, and anything else on the way that might be of strategic value to the Confederates.
2Replace "on its way" with "in its path" to say what you intended it to mean. – Erin – 2019-02-27T01:37:27.100
I don't know how to cite an idiomatic-language question's answer. All I can say is, it isn't incorrect, but I'd use "along its path" because that's what I've heard before. – Mazura – 2019-02-27T03:27:38.010
@Mazura: For example, a native speaker of American English can cite themselves: "To my (American) ear, ________ sounds natural." – Jasper – 2019-02-27T04:29:36.207
"on it's way" relates to objects in close proximity to the path that it follows. Here "way" is essentially a reference to a physical route, although most would not intuitively see it as meaning this. "in it's way" refers to items BLOCKING it's path or lyong ON the path it took so that the fire passed across or through them. – Russell McMahon – 2019-02-27T11:33:03.470
2I'm not sure why you would think "on its way" and "in its way" mean "pretty much the same thing". You can see an apple tree on your way even if you don't see an apple tree in your way... – user21820 – 2019-02-27T11:59:02.457
1
Related: https://writing.stackexchange.com/questions/42684/is-using-an-empty-metaphor-considered-bad-style
– None – 2019-02-27T12:16:12.673