Preheat your oven to 400°F (200°C). Position the rack in the center of the oven. Line a large baking sheet with parchment paper.
Remove the puff pastry from the refrigerator and unfold it onto a lightly floured surface. Let it sit for 5 minutes if it feels stiff — it should be pliable but still cold to the touch.
Transfer the puff pastry sheet onto the prepared baking sheet. Using a sharp knife, lightly score a 1-inch border all the way around the edges — do not cut all the way through. This border will puff up into a golden crust frame. Checkpoint: You are ready to move on when you can see the scored border line clearly without having cut through the pastry.
Brush the scored border with the beaten egg using a pastry brush. This gives the edges a glossy, golden-brown finish as it bakes. Avoid letting egg wash drip down the cut sides.
Spread the marinara sauce evenly inside the scored border using the back of a spoon. Keep the layer thin — about 2 to 3 tablespoons. Too much sauce will make the bottom soggy. Checkpoint: You are ready to move on when the sauce is spread in an even, thin layer that does not pool or drip.
Sprinkle the shredded mozzarella evenly over the sauce, followed by the grated Parmesan. Make sure the cheese reaches close to (but not over) the scored border line.
Arrange the pepperoni slices, sliced bell peppers, mushrooms, and black olives evenly over the cheese layer. Pat any wet vegetables dry with a paper towel before placing them on top.
Sprinkle the dried oregano, garlic powder, and crushed red pepper flakes (if using) evenly over the toppings. Drizzle about 1 tablespoon of olive oil lightly over the whole pizza.
Place the baking sheet in the preheated oven on the center rack. Bake for 18 to 22 minutes until the border is deeply golden and puffed, the cheese is fully melted and lightly browned in spots, and the underside of the pastry is crisp and dry. Checkpoint: You are ready to take it out when the edges have puffed up significantly and turned a deep golden-brown, and you can see the pastry layers on the sides.
Remove from the oven and let rest for 3 to 5 minutes before slicing. Scatter fresh basil leaves over the top just before serving. Slice into squares or rectangles and serve immediately.