I think it is achievable using a pair of stereoscopic images as the source.
That example does not use 2 images, it uses more. Each frame is an image. But yes, you can do that with just 2 images. Normally they are assembled in an animated GIF, Apng, or a looping video.
They rely on the parallax effect in general. But when used in a loop like that example as Joonas mentioned, is called Wigglegram.
The point is having 2 or more images, aiming at a central point from 2 (or more) slightly different initial points of view. (the same principle of a stereoscopic pair of images)
But putting 2 or more images is just 1 part of the process.
You can get those images from a video, a series of photos, some 3D modeling software.
But probably what you are interested in is getting these images from one static photo. Obviously, Mr. Einstein did not have those images taken from him.
So the technique is using a displacement map, and give some height information to some software (Any 3D software can do this), and assigning a camera movement to complete the effect.
Some other techniques to do this imply the usage of masks and retouching a bit what would be the layers further away.
There are some applications that can generate in-between images if you only have the stereoscopic pair, and I am sure there are some applications that can recognize elements of an image and assign depth info to make this.
Some other apps use different cameras from your phone to provide this depth info. (The same info used on iPhone to blur the background) and facebook's 3D photo feature.
Here is a tutorial https://www.youtube.com/watch?v=DInWVvfPQm8 to generate these depth maps and maskings. Use that as a starting point.
Here is one using After Effects and some plugins https://www.youtube.com/watch?v=5vraMi60vWw but there are several methods to do it.
Some video editing software has a function "optical flow" where it generates an in-between frame. Premiere, Davinci Resolve. There is some other AI software. Here is a tutorial https://www.youtube.com/watch?v=mXwXtIiOjRA
You need to test them, because I am not sure if it needs more than 2 frames to work.
But for the simple animation you have, use the other methods, like the displacement map.