In order to enable the magnifier widget in Magento 2 theme, you have to go into the view.xml in your local theme configuration file and then enable the Magnifier widget.
<Your_theme_directory>/etc/view.xml
Now you have to change content like the below code.
<var name="magnifier">
<var name="enabled">true</var> <!-- Turn on/off magnifier (true/false) -->
</var>
Now the view.xml file will have the content
<var name="magnifier">
<var name="fullscreenzoom">20</var> <!-- Zoom for fullscreen (integer) -->
<var name="top"></var> <!-- Top position of magnifier -->
<var name="left"></var> <!-- Left position of magnifier -->
<var name="width"></var> <!-- Width of magnifier block -->
<var name="height"></var> <!-- Height of magnifier block -->
<var name="eventType">hover</var> <!-- Action that activates zoom (hover/click) -->
</var>
Output
