So how does Thunderbird quarantine email attachments?
Not at all.
(For example to prevent other programs from executing malicious
Again, not at all. There's no way this is possible without taking over the OS. Any normal program can read the files where Thunderbird stores it's mails.
If this is a problem because a program could execute malicious attachments, you already have a problem because there's a malicious program already running.
would storing emails offline be a dangerous thing to do?
From a technical point, no. (Depending on the content of your mails, there might be legal problems if mails are found, or anything like that).
In theory it's possible that the text content of the mail contains text that triggers a critical bug (in Thunderbird or in the OS or...), but that's true for all programs, and not likely in case of email text.
However, one thing that you didn't mentioned: Viewing HTML mails.
It would be better to not do that, ie. configure Thunderbird to always display raw text (and ignore senders that are too stupid to include text versions). With any "active" (JS) or external (CSS, images, ...) content, there are plenty harmful things that can be done. And even with things like image blockers and so on, it's still a risk.