Yes, in fact, for some of the oldest libraries it was the destruction that saved them. Before paper, papyrus, and vellum took over as the major media of writing, it was common to write on clay tablets (and that continued long after the introduction of papyrus, et al., too).
Clay is a much more durable writing medium, and so is much more likely to survive. One good example is the Library of Ashurbanipal, who was an Assyrian king of the 7th century BC. It was from this library that the Epic of Gilgamesh was discovered in the 19th century.
But this library wasn't unique, there were a few contemporary libraries as well that were burned down. Luckily, when clay is subjected to fire, it gets harder, so a lot of the tablets, though broken, did survive.
If you want to learn more about ancient libraries, I'd recommend:
A Universal History of the Destruction of Books by Fernando Baez
Libraries in the Ancient World by Lionel Casson
Edit: I think I worded this badly to give the impression that the Library of Ashurbanipal was burned down. In fact, it was one that survived, though the tablets were still frequently broken. But others that did burn were still somewhat salvageable, because of the fact that they held clay tablets.