Stfnal starships were exploring the universe long before Star Trek. I have two candidates, one for earliest and one for most like Star Trek.
Earliest: The Skylark of Space by Edward Elmer Smith, Ph.D. and Lee Hawkins Garby, the first novel in Smith's Skylark of Space series; first published as a serial in Amazing Stories, starting with the August 1928 issue; there is a Project Gutenberg etext and a Wikipedia article. (OK, this was preceded by the 1924 Goncharov novel mentioned in DVK's answer, but Skylark was very influential, and it was written between 1915 and 1921.) Here is the Wikipedia plot synopsis:
At the beginning of the story, Seaton accidentally discovers a workable space drive in combining pure copper with a newly discovered [fictional] element "X" (suggested to be a stable transactinide element in the platinum group) in solution. Having failed to re-create the effect, Seaton realizes that the missing component is a field generated by DuQuesne's particle accelerator, and thereafter sets up a business with his millionaire friend, Martin Crane, to build a spaceship. DuQuesne conspires to sabotage Seaton's spaceship and build his own from Seaton's plans, which he uses to kidnap Seaton's fiancée, Dorothy Vaneman, to exchange for the "X". In the resulting fight, DuQuesne's ship is accidentally set to full acceleration on an uncontrolled trajectory, until the copper 'power bar' is exhausted at a vast distance from Earth's solar system. Using an "Object Compass" that once locked on an object, always points toward that object, Seaton and Crane follow DuQuesne in their own spaceship (the eponymous Skylark) to rescue Dorothy and her fellow-hostage, Margaret "Peg" Spencer, until the Skylark discovers DuQuesne's ship derelict in orbit around a massive dead star (resembling a cold neutron star). Having obtained the hostages, Seaton extracts a promise from DuQuesne to "act as one of the party until they get back to Earth", in which relationship they leave orbit and travel further in search of additional fuel.
On an Earthlike exoplanet, they obtain "X" from an outcrop almost purely of that mineral; then leave that planet in search of copper. Following an encounter with a "Disembodied Intelligence" (Star Trek's "Q" would later show similar attributes), they enter a cluster of stars nicknamed “The Green System” and locate a planet having copper sulfate oceans. On the Earth-like "Osnome", they befriend the rulers of Mardonale, one of the two factions of the Osnomian natives. When the Mardonalian ruler attempts to betray Seaton and his friends, they find allies in Prince Dunark (a crown-prince of Mardonale's rival "Kondal") and his consort Princess Sitar, whom they later assist in destroying Mardonale. In gratitude, the Kondalians make new copper "power bars" and rebuild the Skylark as Skylark Two, with new weapons known to Kondalian science. Thereafter Seaton's marriage to Dorothy, and Crane's to Margaret, are solemnized by the Kondalian monarchy, and Seaton himself declared nominal "Overlord" of Kondal. The Skylark then returns to Earth, laden with jewels, platinum, radium, and a plenitude of "X"; but near Earth, DuQuesne leaves the Skylark by parachute, and the story ends with the Skylark's landing on Crane's Field.
Trekkiest: The Voyage of the Space Beagle by A. E. van Vogt; published as a novel in 1950, it was a fix-up of earlier stories, starting with "The Black Destroyer" in 1939 (Astounding Science-Fiction, July 1939, available at the Internet Archive). Quoting from the Wikipedia article:
A huge globular spaceship, manned by a chemically castrated all-male crew of nearly a thousand, who are on an extended scientific mission to explore intergalactic space, encounters several, mostly hostile, aliens and alien civilizations. On board the spaceship during its journey, both political and scientific revolutions take place.
OK, not exactly like the Enterprise with that "chemically castrated all-male" (and all-human) crew, but close enough. (There were starships with multi-species crews in Edmond Hamilton's old Interstellar Patrol series but exploration was not their primary mission.)