When you buy something in a foreign country, the merchant may give you the option of having the purchase converted to U.S. dollars so you can see how much it costs in a way you're more likely to understand. (See the question about dynamic currency conversion below.) But for the purpose of the foreign transaction fee, it usually doesn't matter whether a purchase is submitted to your credit card company in U.S. dollars or in the local currency. The fee applies based on where the transaction takes place, not how it is denominated.
The one exception among major issuers is U.S. Bank, which charges a 3% foreign transaction fee but knocks that down to 2% if the purchase is denominated in U.S. dollars.