Cube bread, spread on a sheet pan, and allow to dry for a few hours. Heat the oven to 400°F. Lightly oil a 2-quart baking dish.
In a large pot, drizzle the olive oil and place over medium-high heat. Add the onions and stir for a couple of minutes, then add the celery, carrots and apple; continue to stir. When the mixture starts to sizzle, reduce the heat to medium-low and cook, stirring occasionally, for about 5 minutes. Add the stock, sage, thyme, salt and pepper and stir. Gently fold in bread cubes. Transfer to the prepared baking dish, and use the back of the spoon to pat down evenly, compressing to make an even layer. If desired, sprinkle a handful of walnuts or pecans on top and press into the stuffing. Bake for about 30 minutes, until crusty and browned on top. Serve warm. Keeps, tightly covered, in the refrigerator for up to 4 days.