It's not illegal to sell fish over the internet, assuming the fish itself is not somehow restricted (endangered/invasive species, etc). Additionally, if the fish were to come from another country, there would also be import and inspection fees involved.
As to packaging the fish, they are placed in a shipping bag with some water (similar to how you would get them from a local store), and then packed in a box for shipping. The box itself is also padded - depending on the fish and/or seller, this can be anything from styrofoam and packing peanuts to something simple like crumbled-up newspaper. Depending on the weather, heat packs or cold packs can also be included to ensure the temperature doesn't become too uncomfortable. Shipping methods also vary - most commercial sellers will always use Next Day or Overnight to protect themselves, while most private sellers will often choose to use the more economical Priority instead.