There are pros and cons.
The first big con is the price of 'postage'. Royal Mail does not allow the posting of live fish - just fry and eggs - though that does not stop people doing it. Reputable sellers use a licenced courier, and they are expensive. For a couple of fish, the transport costs are often more than the fish.
The second con is that you can't see the fish before buying. You can't see if they are healthy or sick, and very often the seller won't choose males and females, you just get whichever fish they catch. This is not a problem with shoaling fish but it is for fish like gouramis. And with many cichlids, you have to try and buy a bonded pair. Just any male and any female may not get on together.
The biggest advantage is being able to buy fish that no-on locally stocks.
If you do get fish on-line, open the pack in the darkest corner you can find. The fish's eyes will be adjusted to darkness and without eyelids, sudden exposure to bright light stresses them.
Don't open the bag yet. The fish will have been excreting ammonia during transit, but they will also have been breathing out carbon dioxide. This will have dissolved in the water making it acidic, so the ammonia will all be in the less toxic ammonium form. As soon as you open the bag, the carbon dioxide gasses off, the pH rises and a lot of ammonium turns into toxic ammonia.
Float the unopened bag to equalise temperature, then open the bag and net the fish out and into the tank. Yes, the water might be quite different from the seller's water but it takes many days for fish to acclimatise to new water, and you need to get them out of the ammonia-laden water in the bag as soon as it is opened.