I'll start my answer to this one with a simple no. Buying a gas or wood fireplace online is a bad idea, and leaves you with several risks that using a local dealer would avoid.
First and foremost is the fact that you are not a fireplace expert. I say that confidently, even if you're a builder of homes, or you've been flipping them for years. There is a wide range of options available out there, and you will not be familiar with which ones will work in your particular situation. Working with a dealer ensures that you can find the right fireplace for the priorities you have, as well as the local rules and regulations. For example in my market, if you want to purchase a wood stove, you first need to make sure that it meets the county's rather strict rules, which only apply here in this county. Then, you need to have a Dealer Affidavit of Sale sent to the Air Quality Management District if you want to get a permit, to certify that it indeed meets those requirements. You will not be able to get either the advice or the form from an online vendor. Another great example is that vent-free fireplaces are allowed in New York state, but not New York city. You really want to have that professional knowledge to help with your decision.
Secondly, once the fireplace shows up at your home in a 300 pound crate, what will you do with it? In my case, if a client calls and says they purchased a fireplace online, and needs someone to install it, we will not be able to help them. We're basically being asked to put our stamp of approval on a fireplace which we cannot stand behind. We don't know if all the correct parts were ordered (some fireplaces require interior liners, some don't, some require flue adapters, some don't), or that they're in good working order. There are handymen or small contractors that may be willing to install it, but they won't be familiar with the proper installation procedures, and could put you at risk. Additionally they'll charge you much more than a licensed dealer would, because they're on unsteady ground and want to make sure they don't end up on the losing end of the transaction. You could try to install it yourself, but then you'll have the same lingering doubt over whether it was all done correctly. Coming up with some extra parts on an Ikea dresser isn't a big concern, but an Ikea dresser can't burn your house down. To go along with this, many fireplaces require specific venting components that may not be available from the online warehouse, and are required to complete the installation.
Third, good luck getting warranty service on an online purchase. The vendor you bought it from won't be much help, and in most cases you cannot call directly to the manufacturer to get help either. That leaves you going to local dealers, who either won't help, or will charge you much much more than if you purchased it from them in the first place. The biggest manufacturers have set up their distribution through a dealer network for this reason. They want to focus on production, they don't want to get held up with after-sales service. The dealer fills that role for them, and makes sure the manufacturer doesn't lose reputation when the inevitable faulty unit turns up.
Essentially, this all comes down to having someone you can turn to who will take responsibility for getting you the right fireplace, with all the right parts, in good working order, and safely installed. That responsibility is key, and it's what you don't get from online retailers. The savings that you can realize from the purchase are available because of this lack of responsibility. Your local dealer charges more because they're putting in the time to help you select, permit, install, and service your fireplace. For us, a sale is a months-long process, whereas a website puts in virtually no time in assisting you.
So do yourself, and your local community a favor. Resist the temptation to spend a bit less, and instead get a lot more from your local dealer. You'll thank me while you're staying cozy.