At the end of the day, it's really up to you. You can get gorgeous, healthy bettas at a chain pet store- or you can find weak, sickly fish that are half dead in their cups. Some local, non-chain pet stores have great stock and take excellent care of their bettas, and others sell them in unheated vases.
Buying online can mean a higher quality of fish, but there's the problem of them being shipped, often from the other side of the world (Many bettas available online are bred in Asian countries and then imported). And you'll need to be very careful when acclimating them to their new tanks, because the water parameters may be very different- as opposed to buying them from a store in your town, which probably uses the same water source as you.
For me personally I think the ideal would be finding a fellow betta enthusiast at a local show or club and buying from them, because I would feel that they care for their bettas as more than just a potential profit and the fish wouldn't have been stressed by being shipped. Unfortunately that hasn't happened yet, I keep getting suckered in by bettas at the stores near me!
If your fish died within the return period, regardless of whether you plan to get a replacement from that same store, definitely bring in the body (if you have it) and receipt. The company uses information like how many returns of dead fish they get to consider whether to adjust their policies, maybe send someone to train the store workers, etc.