Preheat the oven to 350°F (175°C) and grease a 9×13-inch baking dish.
Spread the apple pie filling evenly in the prepared baking dish.
Drizzle the caramel sauce over the apple filling.
Sprinkle the cinnamon and nutmeg evenly over the apples.
Evenly distribute the dry cake mix over the apple mixture without stirring.
Slowly drizzle the melted butter over the entire surface of the cake mix.
Sprinkle the chopped pecans or walnuts over the top if using.
Bake for 45–50 minutes until the topping is golden brown and bubbling around the edges.
Let the cake cool for 10 minutes before serving.
Serve warm with extra caramel sauce and a scoop of vanilla ice cream if desired.