1) Preheat oven to temperature of 160 degrees.
2) Blanch the octopus in boiling water for about 20 seconds and then refresh in a bowl of cold water. Repeat this process about 3 times to soften the meat.
3) In a large ovenproof casserole, heat the oil and butter together.
4) When the butter is foaming, brown the octopus pieces in it, a few at a time.
5) Life the cooked octopus onto a plate and set it aside.
6) To the casserole, add the red onions and cook over medium heat till it begins to brown.
7) Add the garlic, sugar and balsamic vinegar. Stir and cook over high heat for about 2 minutes.
8) Add the octopus, rosemary and Rioja, turn the heat to simmer and cook for 2 minutes.
9) Add the shellfish stock and bring the ingredients to a boil. Lightly season with salt and pepper.
10) Cover the casserole and put it in the preheated oven. Cook for 2 hours, till the meat is very tender.
11) Use a slotted spoon to life the octopus onto a plate.
12) Bring the cooking juices to a boil over high heat and then let them simmer to a syrupy consistency.
13) Put the octopus back in the juices. Taste and adjust the seasoning if needed.
14) Spoon the aioli or creme fraiche over the top of the hot cooked octopus and serve straight from the casserole, while still hot.