Heat the oven to 160 C / 320 F with a rack in the lower third. Boil water in a 2-quart / 1.9 L saucepan, add the pearl onions for 1 minute, then drain and rinse under cold water. Trim just a sliver off each root end and squeeze the onions out of their skins.
Rinse the octopus under cold water and pat it dry. Check that the beak, a small hard ball where the tentacles meet, is gone, and cut it out if it's still there. Separate the head from the tentacles and cut the head into 4 pieces. Crush the canned tomatoes by hand in a bowl.
Heat 3 tbsp of the olive oil in a 26 cm / 10-inch Dutch oven over medium heat. Add the onions and cook for 6 minutes, turning now and then, until browned in spots. Move them to a plate.
Lower the heat to medium-low and add the remaining 1 tbsp oil, the garlic, and the red pepper flakes. Cook for 1 minute until fragrant but not browned. Stir in the tomato paste for 1 minute, then pour in the wine and simmer for 2 minutes, scraping up any browned bits.
Add the crushed tomatoes, bay leaves, oregano, black pepper, and octopus, and stir so the octopus sits under the sauce. Bring to a gentle simmer over medium heat, about 4 to 5 minutes. Cover and move to the oven for 45 minutes. The octopus releases liquid, so the sauce will look thin, and that's normal. Don't add salt yet, and if the sauce boils hard, lower the oven to 150 C / 300 F, because hard boiling makes octopus rubbery.
Stir the browned onions back into the pot and set the lid slightly ajar. Return to the oven for 30 minutes, until the sauce coats the back of a spoon and a paring knife slides into the thickest part of a tentacle with almost no resistance. If it still resists, cook 10 minutes more.
Remove the pot from the oven and take out the bay leaves. Stir in the lemon juice and 1/4 tsp salt, then taste and add more a pinch at a time if needed. Cover and rest for 10 minutes, then top with the parsley and serve.