If they had a vet receipt, yeah I'd pay it. You need the receipt for the shot record anyway.
Microchip the dog if it is not chipped, it's the only real way besides tattooing to prove ownership.
That said, if I didn't have the money - I'd call the cops, they can't actually keep your animal because they had a vet care for it without your permission.
That's their problem at that point.
We don't vet immediately unless it is injured/ill, when we first find an animal. We do fairly quickly once it appears no one is looking for it. We wouldn't charge an owner for vet care we did give. Though we'd prefer reimbursement - it's something we do ourselves to ensure the well being of the animal and the safety of our own dogs.
When you are taking in a dog, if you don't have enough food, even if the dog does not eat alot you still have to buy the WHOLE bag of food. It doesn't come in parts. It is reasonable that a new bag of food cost 10-25 dollars depending on quality and size of bag.
So shots and a bag of food. Yeah that's a reasonable amount but it in NO way would OBLIGATE you to pay it, to recover the dog. That's on them. If they know it's your dog, they have a legal obligation to give the dog back or they're stealing.
Do protect yourself long term and chip the dog. People do steal or keep dogs they find. Chips and tattoos are the only way to prove ownership.