How Can I add a menu to the theme from withen the function.php file

I think your current call to wp_nav_menu() may be echoing the menu when the code is seen and not returning it in the function.

Try this call:

wp_nav_menu( array(
    'theme_location' => 'legal_footer_navigation',
    'echo'           => false,
) );

If that works, you can also probably remove the echo parameter from the register_nav_menus() call.