Both TSMC and ASML are just the tip of an iceberg. Each has thousands of supplier companies spread across many countries. Many of these supplier companies are peerless themselves in their respective areas.
It's a lot less concentrated on those two countries than it seems, but at the same time things are even more fragile than your post would imply.
The lithography/EUV optics comes from Zeiss. The laser for generating the plasma from Trumpf. Both key elements that ASML would not be able to build in-house or get from a different supplier.