The book series you are most likely looking for is The City of Dreaming Books series by Walter Moers.
From Wikipedia:
Protagonist Optimus Yarnspinner (Hildegunst von Mythenmetz in the German text) is a Lindworm (dinosaur) who inherits his authorial godfather's possessions, including a perfect story written by an unknown author, in search of whom he travels to Bookholm, a city devoted to literature above labyrinthine catacombs containing many valuable books, among various monsters and perils. There, a publisher directs him to antagonist Pfistomel Smyke, who possesses the most valuable books on the market and controls the book trade by musical hypnosis. At his house, Smyke reveals his plan to eradicate all forms of art in Zamonia; drugs Yarnspinner; and transfers him to the catacombs.
It features a Lindwurm = dragon as protagonist going to an underground city of living books.
The pirate captain form his other story in the same world is most likely "Die dreizehn 1/2 Leben des Kapitän Blaubär" (The 13½ Lives of Captain Bluebear) which is based on a part of the "famous" German kids show/educational Sunday noon show "Die Sendung mit der Maus".