H-1B renewal in a country in an embassy in a country different from the home country

My H-1B visa has expired, and my renewal was approved. I need to travel to another country for a wedding soon, and that means I need to get my visa stamped before entering the US. I am not planning to travel to my home country. Can I get my visa stamped in a country other than my home country? I know that I can do it in Canada and Mexico. But, I am trying to avoid going to these countries just for the visa stamping.

You can get visa stamping in any US embassy. Just check their local rules as sometimes some embassies do not allow third country nationals due to security/fraud reasons.