Backing up and restoring all databases in MySQL on linux
The exact syntax used varies depending on what version of MySQL you are using, but the basic version of mysqldump (without any other options) you are using will run:

CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /;

DROP TABLE IF EXISTS `test1`;
CREATE TABLE `test1` (. . . 


You can check this if you are concerned, before running the second statement, simply look in the file dump.sql (it is just a text file) and you can see clearly what queries it will run. 

So to answer your questions:


  will the second command overwrite an existing table with the same name as on the first computer ?


Yes it will


  will the second command delete all tables which are NOT there on the first computer?


No it won't

You can get a full list of the options available from: https://dev.mysql.com/doc/refman/8.0/en/mysqldump.html#mysqldump-option-summary