How can i match CiviCRM ID on two installations?
Depending on your end goal, one solution is to set the External ID of a record in instance B, to the Internal ID from instance A. 

The Internal ID (civicrm_contact.id) is a primary key; the database engine assigns that field, and you risk data corruption by trying to keep it in sync yourself. The reliable way to keep them in sync is to have instance B act as a Replication Slave of instance A, where data changes in A are copied to B (but not vice versa).

If you can tell us more about what you are actually trying to achieve (as a new question), perhaps we can help you with the greater goal.