It's like buying lunch. When your manager does it, you thank him. When your cow-orker does it, you think "what is this guy up to?"
An American visiting from other company was completely dumbfounded: Why have you paid yourself?? He is your boss, it’s his responsibility to pay when he invites you to lunch!!
...And I was completely dumbfounded observing his reaction: have Americans no pride?
Buying small gifts for coworkers is one thing, but buying lunch is a bit much. I wouldn't spend more than $5 on a gift for a coworker.