Sand and gravel have numerous sizes and physical features that affect BB populations.
If you are not using an UGF, I think evidence suggests that the substrate will hold only a small portion of the tank's bacteria. Conditions in any tank will allow some BB in the substrate, but it would not the be where the majority of BB exist.
If you are only using an UFG, then you will have most (all?) of the BB in the substrate. The answer to sand versus gravel depends on which types of sand versus which types of of gravel you are using, at what depth, how much / how well you are flowing water (oxygen) through the substrate.