Hydrocarbon exploration under thrust belts is a challenging frontier globally. In this work, 1-D thermal maturity modeling of the Paleozoic–Mesozoic basement in the northern margin of the Western Outer Carpathians was carried out to better explain the thermal history of source rocks that influenced hydrocarbon generation. The combination of Variscan burial and post-Variscan heating due to elevated heat flow may have caused significant heating in the Paleozoic basement in the pre-Middle Jurassic period. However, the most likely combined effect of Permian-Triassic burial and Late Triassic–Early Jurassic increase of heat flow caused the reaching of maximum paleotemperature. The main phase of hydrocarbon generation in Paleozoic source rocks developed in pre-Middle Jurassic times. Therefore, generated hydrocarbons from Ordovician and Silurian source rocks were lost before reservoirs and traps were formed in the Late Mesozoic. The Miocene thermal overprint due to the Carpathian overthrust probably did not significantly change the thermal maturity of organic matter in the Paleozoic–Mesozoic strata. Thus, it can be concluded that petroleum accumulations in the Late Jurassic and Cenomanian reservoirs of the foreland were charged later, mainly by source rocks occurring within the thrustbelt, i.e., Oligocene Menilite Shales. Finally, this work shows that comprehensive mineralogical and geochemical studies are an indispensable prerequisite of any petroleum system modelling because their results could influence petroleum exploration of new oil and gas fields.