I was wondering if a rock/magma eating creature could survive on earth, I have searched about creatures which could do this, but all I have found involves silicon-based life forms which could not thrive on Earth.
Almost. The deep sea thermals have shown that creatures can live off of hydrogen sulfide given off by lava. Given enough of such vents, a large creature can live off of that process. It isn't living off of the rocks / lava directly. Instead, super heated water extracts the hydrogen sulfide. The process is that bacteria are the first part of the food chain. Then, smaller creatures feed off of the bacteria. Larger creatures can live off enough of those smaller ones.
It would be a real challenge to have a creature grind up enough rocks and have sulfide extracted in a stomach to support an active life style. Perhaps a very sedentary life would work.
Rock eating yes, magma eating no.
Nothing survives lava, nuff said. Rock eating on the other hand does happen in nature, just not for food. Birds swallow rocks but it’s for the gizzard they use to grind their food in their stomach, because they have no teeth. Getting food out of rocks would require plants and that would require a creature that grinds rocks to make a suitable spot to grow for plants. Pair that with feces as fertilizer and you’ve got a rock crushing farming animal. Teeth are stronger than most rock, so with strong jaws there’s nothing stopping an animal from shattering rock with its maw. Parrotfish grind corral with their beaks which makes sand, but corral is soften compared to rock.
Edit: [Volcanic rock is very fertile for plants but needs to be eroded first. The rock eater would munch on rock to make it easier for the plants to process it and then eats the plants that grow from that.]
Yes, it's called geophagy.
The best known example is salt. Have you ever eaten salt? Then you've eaten rocks.
While plants and animals can't digest many rocks, fungi often can. Rocks contain minerals, carbon, calcium, lots of the same things as more familiar foodstuffs, just in a form that needs a different digestive system. We know such digestive systems are possible because fungi did it and originally colonised the land, nomming rocks and pulling them into the biosphere. We've never seen such a digestive system in an animal in real life, but in fiction why not?
This answer is based on the assumption that creatures eat to derive energy from external substances. Evolution and available resources will shape the tools and organs animals will develop to eat. On earth, no large animals have evolved having lava or rocks for dinner, so I assume the beast is alien..
Magma eating yes, rock eating no
Lava contains plenty of energy and would be easy to swallow, when the physiology of the beast allows that. Heat can be directly extracted from the lava. The hardening lava should be released quickly after dinner, else the beast would suffer from constipation !
Rock on the other hand, requires a lot of energy to eat in the first place. The energy needed to crack and grind a rock cannot be derived from energy available in (already strong) chemical bounds in the rock material. A rock consist of oxides of Si and metals. Breaking these chemical bounds would require energy, instead of releasing it.
Magma no, you're talking about an environment with continuous temperatures in excess of 1000ᵒC, there simply aren't organic compounds that stay stable at those temperatures. The most heat tolerant creatures we know of are the Bacillus genus of bacteria they can survive, in their dormant state, less than half of that.
In terms of eating rocks the metabolic pathways of interest are going to be similar to those of the Sulfur Reducing and Iron Oxidising microbes. These are going to be anaerobic metabolic pathways, producing relatively little energy compared to the aerobic metabolism of carbohydrates common to all vertebrates. Such life is probably limited to single cell creatures, although stromatolites show that single celled life need not only show up at the microscopic scale.