How can I create a menu items from meta box based on users input

Here’s how I understand this task: get posts (you can shape this any way you want by adding extra parameters to the query), for each post get its meta-box value (replace the key with yours), if value found add it to the menu’s HTML.

Note: code is not tested, it is more of an outline.

$domain = 'your-domain'; //
$meta_key = 'your-meta-key'; // TODO replace value with yours

$post_menu_items = get_posts( array(
    'post_type'     =>  'post',
    'post_status'   =>  array( 'publish' ),
    'numberposts'   =>  -1
) );

    $html .= '<ul>';
    foreach ($post_menu_items as $key => $menu_item) {
        $meta_title = get_post_meta($menu_item->ID, $meta_key, true);
            $html .='<li><a href="#' . $meta_title . '">' . $menu_item->post_title . '</a></li>';
} else {
    _e('No posts found.', $domain);
echo $html;

Thinking about it, you could even avoid the get_post_meta call by supplying a meta_key parameter into your get_posts. You’re welcome to experiment with that.