Taiwan is a very small island with a single port of entry that can be locked-down by a couple of guys with submachine guns. They also have a culture of wearing masks all the time due to pollution and dust from the Chinese mainland. They already have dealt with an even deadlier coronavirus, SARS, so they were certainly better prepared.
Germany is certainly more like the US in terms of demographics, economics, and access, but it is one country in the EU. There are regions of the US that have handled the virus reasonably well like Germany, such as New England. You can certainly compare Germany to New England, but if you want to compare Germany to the overall US, you need to include Spain, Italy, and France in the equation just like you'd include Florida, Texas, NY, and California on the US side.