how to show all categories by get_terms

The reason it’s only getting parents is this part:

parent=0

This queries categories that don’t have a parent, so you only get the top level. Remove it and you’ll get all categories:

get_terms('category','hide_empty=false')

That being said, you’d be better off using wp_dropdown_categories(). That way you will get the proper ordering and indentation of child categories:

<label for="<?php echo $this->get_field_id( 'link' ); ?>">
    <?php _e( 'دسته بندی' ); ?>
</label>     

<?php
wp_dropdown_categories(
    [
        'id'       => $this->get_field_id( 'link' ),
        'name'     => $this->get_field_name( 'link' ),
        'class'    => 'widefat',
        'selected' => $instance['link'],
    ]
);
?>