I would feel very uncomfortable doing that. If I had a long term relationship of always going to that mechanic it might be different, but you wouldn’t know how a stranger might take it. He could be saying “that cheap guy thinks a hat will give him special attention”. Doing it because it makes YOU feel good is admirable, but to do it because you expect something from it is questionable.
BTW....I bought my Honda over 100 miles away because my local dealer was $3500. higher and would not budge. I told him then I would be forced to buy elsewhere and told him I would rather support the local dealer because if I had warranty work I would be coming back to his dealership. I still was paying $800. over invoice (which was still too much IMO) at the other dealer at a time when the U.S. makers would have been begging me to buy thousands below invoice. The point.....when I took the vehicle back for a warranty recall to my local dealer whom I did not buy from, they did the work, checked and topped all fluids, washed inside and out and cleaned the wheels.....and all for no hat. I did however buy 12 quarts of their $4. transmission fluid. Do I regret not buying there? NO....they wasted a lot of my time with “come on” ads locally that sucked me in to an obnoxious salesman who tried to twist the deal into different terms a dozen times with the same bottom line and expected me to not realize the bottom line was the same....and only to have him comment “perhaps you should consider a domestic vehicle”. Suspect too many dealers have a disconnect between their service and sales departments. Another domestic auto dealer gave me a very bad deal in their service dept, so bad I would never consider buying an auto from them even though I have heard their sales are strong, and my credit card company removed charges from the bill. That dealer lost that particular franchise not long after having charged us for work that was never done. The stupid thing is I was close personal friends with one of his retired top mechanics who informed me how bad they were. This former mechanic had been told by the owner years previous “you are not hired by me to make the customer happy, you are here to make the dealership money, that’s why I pay you top salary”. The mechanics get stuck between honesty and crook dealers.