Actually, Hydrogen and Oxygen are highly reactive elements which react almost with all types of metals and nonmetals. So, the nature and similarities in oxides or hydrides could be the basis of classification on behalf of which the elements could be grouped together, because the elements with similar nature will definitely have similar types of hydrides and oxides.
Thus, Mendeleev used the oxides and hydrides for the basis of classification.