Yes, it is possible to combine the same two elements to form two different compounds. An example is carbon dioxide CO2 and carbon monoxide CO. This is because two elements can form different types of bond and end up with different compounds.
There is a limited number of elements but a large number of compounds because of the above reason.