But most of the time they try to turn it down, because department regulations prohibit it in most places. Some places (in the old days) used to do it to try to curry favor and get better police protection. That is not really the case any more. Everybody knows that cops lock up the guy who bought them the free meal, just like they do the guy who charged full price.
It is embarassing in someplaces, and some places won't take no for an answer, so you end up leaving a BIG tip. And someplaces are so flagrant aboit it, you stop going there.
Back in the old days, when we made less money that any other public servant, we interperted it as a nice gesture. Now, we aren't sure why people do it. I guess it is somewhat akin to a professional courtesy. Lots of restaurants give half price to the guys who deliver to them, or the plumber who fixes their rest room.
As far as the donuts, I love them, but don't eat too many any more, I have gotten too fat. But i do drink lots of Convenience store and donut shop coffee. Once upopn a time, only diners were open at night, all night, and it gave a police officer someplace to take a break from either foot or mechanized patrol. In the middle of the night, there are different people out and about in the world. So, the newspaper delivery man, the cop, the donut shop waitress and the bartenders going off duty are the only people around and they would often all come together in the diner or donut shop.