Funny how Lava doesn't even make it a cold bath for DB characters lol
Lightning is much hotter than lava.
More than 20 times hotter in fact.
Magma is only 1,400°C at best while lightning is around 30,000°C (about 5 times hotter than the surface of the Sun).
But it's not like either of those could damage strong characters since we literally see a crazy amount of people tank Enel's lightnings and we also see one of Whitebeard's commanders (Curiel) lying down in Akainu's lava in Chapter 579 despite it being so hot that it is capable to instantly vaporize swords from a meter away.
So if Kaido is killed or damaged by "magma" there better be a good explanation.
If it's the core of the planet then I guess it's fine because it would be different enough to be acceptable.