With no large-scale granitic continental crust, all environments on Mars are fundamentally derived from basaltic sources or, in the case of environments such as ices, evaporitic, and sedimentary deposits, influenced by the composition of the volcanic crust. Therefore, the selection of samples on Mars by robots and humans for investigating habitability or testing for the presence of life should be guided by our understanding of the microbial ecology of volcanic terrains on the Earth. In this paper, we discuss the microbial ecology of volcanic rocks and hydrothermal systems on the Earth. We draw on microbiological investigations of volcanic environments accomplished both by microbiology-focused studies and Mars analog studies such as the NASA BASALT project. A synthesis of these data emphasises a number of common patterns that include: (1) the heterogeneous distribution of biomass and diversity in all studied materials, (2) physical, chemical, and biological factors that can cause heterogeneous microbial biomass and diversity from sub-millimetre scales to kilometre scales, (3) the difficulty of a priori prediction of which organisms will colonise given materials, and (4) the potential for samples that are habitable, but contain no evidence of a biota. From these observations, we suggest an idealised strategy for sample collection. It includes: (1) collection of multiple samples in any given material type (∼9 or more samples), (2) collection of a coherent sample of sufficient size (∼10 cm3) that takes into account observed heterogeneities in microbial distribution in these materials on Earth, and (3) collection of multiple sample suites in the same material across large spatial scales. We suggest that a microbial ecology-driven strategy for investigating the habitability and presence of life on Mars is likely to yield the most promising sample set of the greatest use to the largest number of astrobiologists and planetary scientists.