When I finished my business trip, my customer unexpectedly invited me to his home for dinner. Can I say "I am flattered" to show my unexpectation of their kindness? And what else can I say in this kind of situation?
I would say that 'flattered' is not quite the correct word to use in this instance. One is usually flattered by receiving a compliment or praise, often lavish in nature. Imagine your customer had said something like:
This would be considered flattery and you may be flattered as a result. That your customer asked you to stay for dinner is generous indeed, but I wouldn't say it amounted to flattery, unless of a most indirect nature.
But to answer your question, I would suggest a more appropriate response may have been "I am grateful" rather than "I am flattered". Additional comments you could make would be along the lines of:
And so on.
No, it does not have negative connotations when used this way; you may use it. I've used it myself. However, it does not signify that the customer's action was unexpected. It expresses modesty (as in I don't deserve this kindness).
As to what else you can say, don't forget Thank you!