I'm accessing my Gmail account via imap with Thunderbird.
When I move a mail to the imap spam folder, that action equivalent to using the Report Spam button inside Gmail's interface? Does Gmail's spam filter learn from this action or not?
I was wondering the same thing myself. The answer is Yes.
How is spam handled?
Gmail's spam filters also work in your IMAP* client by automatically diverting messages that are suspected of being unwanted messages into '[Gmail]/Spam' and keeping them out of your inbox.
If you find a message that should be marked as spam, just move it to '[Gmail]/Spam.' This is just like clicking 'Report Spam' in the Gmail web interface and helps us to improve our spam filters.
If you find a message wrongly classified as spam, you can move the message out of '[Gmail]/Spam' to the appropriate folder in your client.
Note that your client may have its own junk mail filtering technology, which is separate from Gmail's spam filtering. We recommend using only Gmail's spam filtering and turning off any additional anti-spam or junk mail filters within your client. If you still decide to enable client side spam filtering, your client will download an extra copy of every message.
*IMAP: IMAP (Internet message access protocol) lets you download messages from Gmail so you can access your mail with a program like Outlook Express or Apple Mail. IMAP syncs the actions you take in Outlook Express or Apple Mail with Gmail so if you read a message in your mail client, it'll be marked as read in Gmail.
Taken from this Google Help Article
Using the button in Gmail and the imap spam folder from Gmail is an equivalent action.
Junk mail and spam:
In my experience, using Apple's mail client with Gmail (imap), there will be a spam folder specific along with the other labels, synced as folders. That's the folder you should be using - not anything that's Thunderbird specific.