Here's how I would feel about various expressions of thanks, for something like writing a letter of recommendation:
No response at all: I might be a little disappointed but if I am busy I might not even notice. Some people might be more offended.
Email saying thank you: Feels perfectly sufficient to me.
Handwritten note: A very thoughtful gesture.
Token gift (small box of candy, desk trinket, etc): Appreciative but slightly embarrassed.
Gift of non-negligible monetary value: Quite embarrassed. I would probably gracefully try to decline it.
Gift of money, in any amount: Very uncomfortable. Feels like a bribe. I'd refuse.
Of course this could vary by culture (I'm in the US).
Regarding gifts for an advisor: A common tradition is to give your advisor a nicely bound copy of your dissertation, for their reference and as a memento. (Also be sure to thank them in the dissertation!) You could accompany it with a nice personal note. But again, I wouldn't suggest anything of significant value.
This may vary from country to country, but I think a simple "thank you" is sufficient. Writing letters is part of their job.
I'm actually forbidden from accepting gifts from students, on the grounds that an outside observer might interpret the gift as undue influence. But then, I work for a state whose last two governors are in prison for various flavors of corruption.