During and after WW2, US were the largest exporter because power house like Germany were so wipe out on their factory heart land. The rest of the world also gone back a few decades of progress after the basic infrastructure are being destroyed in the war.
US has its manufacturing base in tact and untouched during the war. The rest of the world need to buy from US to rebuild their infrastructure. While products in the US were sold with premium, basic commodities from the rest of the world were being sold at huge discounted. Profit from the trade (US) were also used to acquire cheap basic commodities producing estate/farm from the rest of the world. This allow US to become enormous wealthy and enable US to capture the resources of the rest of the world and hence setting the stage for USD dominant.
We are at a stage where the rest of the world has caught up and upcoming power trying to free themselves from the USD relationship. How event unfold in the future is anyone guess.
This was helped by the IMF (Or fed, I have to check my source) and World Bank, which had their memberships sold in "shares" or something, and required a few percent to be paid in USD. Countries were loaned to in USD by said institutions, and then USD began cycling more regularly throughout European countries.
As such, debt in millions of dollars was created in USD, workers rebuilding we're paid in USD, and they had to exchange it, but they were getting paid.
It was a great plot, cause the IMF (Or fed) and the world bank were created right after WW2, within 10 years of the end of the war. Their membership payment forms were great ways to peg the USD as the world currency.