In my experiences I've found that, yes, it varies by library. To my knowledge, all the local libraries I've ever had experience with allow requests. How fast those requests are processed, and whether or not they are often acted upon, would vary by library, available funds, popularity of the request... and so on.
I have considered donating my book to my local library - just haven't gotten myself organized yet. I've also had readers talk about ordering extra copies and donating it to their own library.

However, someone here on HW asked their library to add my book and their library ordered three copies! I have the paperback edition of my book available through Amazon/CreateSpace's expanded distribution channel, which allows distributors, libraries, schools, etc. to order the book at a reduced price. I don't get a lot from the sale (and it takes forever for the sales to show up, or so it seems...), but to me that's a fair trade for getting my books in libraries and other distribution channels.
So if you're using CreateSpace, consider setting your list price such that you can enable expanded distribution. You never know when a library might want to order it, and it's good to have that option open!