If you are using fresh store-bought or homemade dough that has been refrigerated, set it out on a lightly floured surface and let it rest for 30 minutes before making your pizza. (The gluten in the dough will relax as it comes to room temperature and the pizza will be easier to work with.)
Caramelize onions: Heat a large skillet with olive oil (portion for onions) and butter over medium-high heat. Add onions and saute for about 5 minutes to get them started cooking. Sprinkle onions with salt and sugar (if using). Once the onions have softened slightly, reduce the heat to low-medium and continue to cook onions, stirring often, until they are dark golden brown and super tender, 30 to 50 minutes. (Note: To prevent burning, add a splash of water to the pan if the onions start to dry out or look like they may burn.)
Heat Oven: Preheat the oven to 500°F / 260°C. (If using a pizza stone, make sure the stone is in the oven as it heats.)
Prepare pizza dough by stretching it out on a sheet pan or on the counter (if you are using a pizza stone / pizza peel).
First Bake (5 minutes): Bake the pizza dough for 5 minutes without any toppings. This gives the crust a head start on getting a nice golden brown color and will help it to hold up to the toppings.
Remove the pizza from the oven and brush the entire surface with olive oil (portion for the pizza). Top with onions, rosemary, and cheese.
Second Bake (10 minutes): Bake pizza until crust is golden brown and cheese is melted, 10 to 14 minutes.
Slice and serve.