using get_template_part() inside a widget and passing variables

Indeed, get_template_part is meant to be used in themes only, though that would include widgets inside your theme. Looking at the source code of the function you’ll see that the main reason for this is that get_template_part does some extra theme related stuff before it calls locate_template in a non-default way.

That said you should have no problem calling it from a widget, so the issue most likely is that your loop.php is not in the place where WP is looking for it.

Refer to this answer for passing a variable to a template.