Is there anyway we can match sales invoice number with sales order number?
If you mean SO Number can related to SI Number, or backwards
Maybe you can edit on among one of the Doctype then add Field with Link Type then fill Options to another Doctype. Then you can know which is linked to which.
But if u really want to match the name like
S0001 on SO number and S0001 on SI Number
you can do this at naming series, but not recommended.