In this case it was the Bell Services at the Poly drop off area who told us to take one for the groceries (likely they were bogged down and there were perishables in our order). I don't know of any specific rules, but I'm sure they certainly prefer you to allow Bell Services to serve you (if they just let everyone take a cart they wouldn't have any to use themselves). I have also many times seen guests ask to borrow a cart and they were allowed to do so by Bell Services. So they probably don't want you taking them on your own at WDW (it's much different at Disney Vero Beach where they are there for you to use and return). When we see carts left by the elevators, I've also seen guests use those as well. It all comes down to common sense and courtesy as far as I'm concerned.
Edited to add that I just found a PlanDisney reply about carts and they said pretty much what I expected: Bell Services manage the carts, as they try not to have them left all over the hotel (so when you see those hallway carts it likely was not BS who brought it there). So you can always ask if you have a special request etc. We rarely use them, except in this one case with Instacart (which was less than great so it was a one and done with Instacart for us).