This is an extremely broad question, so I’ll try to answer it from a worldwide viewpoint.
If you’re asking about perhaps the most well-known public libraries in the world, often these are found in large cities that have been established for quite some time, as this allows for the library system to be established, grow, and receive collections and donations from the city’s large population. Two of the most famous libraries in the United States are the Stephen A Schwartzman brance of the New York Public Library which you may have seen in many movies and TV shows, and the Boston Public Library, which was established in 1848.
In the United Kingdom, there are a number of public and private libraries, though some of the most famous are often aligned with the oldest colleges and universities in Great Britain. For example, there is the Bodleian Libraries at the University of Oxford, which contain more than 12 million items and are 400 years old. The Cambridge University Library, in Cambridge, England, is celebrating its 600th anniversary this year.
There are numerous libraries throughout Asia, South America, and Africa, such as the Liyuan Library in Beijing, the Jose Vasconcelos Library in Mexico City, and National Library of South Africa, that are considered works of architechtural marvel or contain books and manuscripts that stretch back to humanity’s earliest written history.
All the libraries I’ve mentioned are accessible to the public, though some sections may be private, or require an appointment. is an overview of several other famous libraries worldwide, including a few I’ve mentioned.