In the US it’s way more complicated than that, and not just because there are 50 states that all have their own laws on whether or not the prevailing party can recover costs and it furthermore depends on the specific action.
FALSE! FALSE FALSE FALSE! There are many, many circumstances in the US where the loser has to pay costs and attorneys fees. Like copyright infringement. https://www.copyright.gov/title17/92chap5.html#505