It depends very much on the species. We can hold up to 6 Octopus warringa as they will sort out a pecking order based on size BUT there is no way we could have 2 Pinnoctopus cordiformisin the same tank there would cephalocide committed in a very short time!
The other thing is, you need serious filtration for one octopus, two would overload many filtration systems and you'd need a BIG tank. 55G is big enough for one octopus (bimac sized!) but would be very unstable (chemically) with two.
Some years back, the Monterey Aquarium O. Rubescens exhibit had several small octos in it together. I have no idea if that was an experiment that didn't work out, though.
I was greatly amused to see one octo swim up to a large empty barnacle shell, reach a few arms in, and evict the other octo that was hiding in it, then go in to claim it for itself. I seem to recall that there was a third octo hiding in a corner when all this was going on.
However, as others have said, the anecdotal evidence is that more often than not one of the tankmates ends up as lunch for the other. Also, there is some evidence that the octos are uncomfortable all the time, maybe because they always have to be on guard in case the other one tries to eat them. Remember, octos are pretty much solitary in the wild, although being eaten by breatheren seems to occur with the social cephs like squids and cuttles a lot, too.
i had a scary moment in my dream last night about this...
basically i had an octobus in a tank at home and somehow the place got flooded and a bigger octo got in. i got frightened and they started fighting so i tried to peel them apart with a stick! in the end the big one killed mine but i'd also killed it with the stick so i was pretty much an idiott
i ended up feeling unhappy for a large part of the day after that dream
btw, i've got no real octopus connection...
last weekend i saw a really cool one whilst snorkeling... amazing camoflage...
i decided octopus are too remarkable to eat so i won't eat them any more.