Based on my experience 20 years ago you could only renew the H-1B visa in the passport in-country under extraordinary circumstances. In the majority of cases they reject your request and would tell you to travel to a consulate.
Prior to the mid 00s you could renew at any consulate but they changed it so you could only renew in your home country.
loading story #49458367