Can I set a different default browser for localhost sites?
There are a few apps that I think might be able to accomplish this.

The first that I would recommend is Choosy ($10, trial available). That's the one that I use. I recommend it first because you can download it and try it before you pay for it.

There's also Browser Fairy which is $5, but it's in the Mac App Store, and there's no trial version available. I own it also, and I think it's good, but I have had Choosy for ages and it continues to work for me, so I've stuck with it.

I would recommend checking out Choosy, and see if it does what you want. You can easily set a default browser and then set exceptions for specific sites, building criteria similar to how you would make a Smart Mailbox in Mail.app.