Let’s tackle these questions one at a time. Not necessarily in order.
Why are the slices triangles? Individual-sized round pizzas would take more work to make, would tend to cook unevenly in the oven, and would cool down much more quickly due to their greater overall circumference compared to a large round pizza of equal weight. And the easiest way to cut a large round pizza into equal-sized pieces is to section it, much like nature does with the sections of an orange. These sections are necessarily roughly triangular. But cooling faster is the real killer, economically. No one gets excited sitting down to eat lukewarm pizza.
Why are the boxes square? Again, economy. There’s no waste when square boxes are made, and they can easily be folded up from flat die-cut cardboard. Round boxes would be much more expensive to produce. Also—the square box gives the impression of a larger amount of food. You’re “selling” the empty corners of the box.
Why are pizzas round? It’s only the American business model that makes them round. My theory is that the completely (or nearly) equal sections of a pizza appeal to the American sense of egalitarianism. It’s the illusion that everyone seated at the table is equal. And then there’s the invented showmanship of the pizza throwers. In that case, it’s rotational acceleration that makes the pizza round—but the showmanship of the pizza maker in the window that brings more customers to the shop. And of course the round shape makes the square box delivery channel more profitable.
So really, the answer to all three questions is money.