Petroleum microorganisms play a crucial role in the application of microbial-enhanced oil recovery, and the community structures of petroleum microorganisms have been widely studied. Due to variations in reservoir geological conditions, reservoir microbial communities exhibit unique characteristics. However, previous studies have primarily focused on microbial community changes within a single well, a single block, and before and after water flooding, and thus, cross-horizon and cross-regional comparative studies of in situ microbial communities are lacking. In this study, the 16S rRNA full-length sequencing method was adopted to study bacterial communities in crude oil samples taken from two wells at the same depths (depths of 2425 m and 2412 m) but approximately 20 km apart in the Hujianshan oilfield, located in the Ordos Basin. At the same time, the results were combined with another layer of research data from another article (from a depth of 2140 m). The aim was to compare the differences in the microbial community structures between the oil wells on a horizontal scale and a vertical scale. The results revealed that there were minimal differences in the microbial community structures that were influenced by the horizontal distances within a small range (<20 km), while differences were observed at a larger spatial scale. However, the dominant bacteria (Proteobacteria and Bacteroidetes) in the different oilfields were similar. Vertical depth variations (>300 m) had significant impacts on the communities, and this was mainly controlled by temperature. The greater the depth, the higher formation temperature, leading to an increase in thermophilic and anaerobic bacteria within a community.