Where can I buy NTD/TWD and/or HKD in San Francisco, preferably around Union Square? If there are such places at all. And is it more reasonable to do so rather than exchanging USD to NTD/TWD in TPE airport and also exchanging USD to HKD somewhere in Taipei?
You can probably order those from your bank. My bank, the Bank of America, for example, offers same-day shipping of foreign currency if you order before 2pm, which you could then pick up in the closest BoA financial center.
If you have an account at a major bank, it is likely that you'd be able to order HKD and NTD and have them delivered on the same or the next day. Also, banks usually have better rates than currency exchange stores. (Since you're asking here, I assume you're not in a hurry, right?)