Yes, you can leave a book back in any public library - it doesn't matter where you borrowed it from.