No, it doesn’t matter if the book is at a library or on my friend’s bookshelf, copyright law is literally the right to copy the thing. So if I make an illegal copy, I’m breaking copyright law. The “ToS” I’ve “agreed” to is the law of the country I’m in.
You agreed to the ToS given by the library.
Hence why you have to get a library card to check out a book.
Okay, and if I find the book on the street?
No, it doesn’t matter if the book is at a library or on my friend’s bookshelf, copyright law is literally the right to copy the thing. So if I make an illegal copy, I’m breaking copyright law. The “ToS” I’ve “agreed” to is the law of the country I’m in.