The answer is no! If the grounds are connected together you have no isolation. Connected together means no isolation.
It is possible to us an optocoupler for something other than isolation of grounds, for instance the output portion of the device can float within a circuit to function as a switch of a way to change the circuit it is meant to control and in this way isolating the controlled device circuitry from the ground-referenced control input. But if the two grounds are tied together, this idea is to control something with the optocoupler's output and to not achieve ground isolation.