Journey to the Center of the Earth is not scientifically accurate. However, Verne did his best, while still providing an exciting story, to keep it accurate to cutting-edge science as it was understood in the early 1860s.
The rapid growth of science in the nineteenth century had developed an appetite...
for scientific information on the part of public, and the group of novelsJourney is part of reflects an attempt to feed that hunger. Verne leaned into what at the time were cutting-edge theories in geology that asserted that the earth evolved over a long span of time rather than being made in a day, as stated in the Bible. One of the geological theories that the book draws inspiration from is called the Hollow-Earth theory, which posited, as the name implies, that the earth was hollow in the center. According to this theory, it would have been possible for the deep, inner parts of the earth to be explored, as Otto, Axel, and Hans do.
What makes this novel an early work of science fiction is its attempt to be as scientifically accurate as possible. There is no magic in this imagined world, and the professor does what he can to provide a logical scientific explanation for everything they see, from why there is light in this underground world to why their path through a cave is blocked by rocks.
However, such events as three explorers being spewed safely out of the earth's center via a volcanic eruption would be entirely impossible. In addition, much of the science of the 1860s is now known to be mistaken.