It's nothing like the U.S. The U.S. has goofy policies most other places do not concern about. I am not sure about transfers in BKK. I have always terminated here. You can hang out in Shanghai for 6 days without a visa
***********************************
%2F24&pws=0&gl=us&gws_rd=cr
And there is a Thai consulate there
*************************************************
You could, in theory, get a visa in-route to Thailand.