How to morph a sphere into a torus in blender
Modeling &amp; shape keys

You can somehow fake the effect with shape keys.

It's just a matter of grouping vertex in the target position. The way about how to approach a similar problem could be various, and they really depends on the shapes.

Start by creating two shapkeys and enter edit mode to start changing the vertices position:



If we for example consider the morphing from a sphere, you could start by selecting the inner faces of the thorus and then scaling everything toward the center and then on the Z axis:



Invert the selection and start running alternatively the command "smooth vertex" and "to sphere".  The purpose would be to better distribute the edge loops to mime a UV sphere topology (at least outside). Then scale the whole selection to match with the lower and upper vertex.



Result: