The consumption of beverages, fast foods, fats, and oils has been recognized as key risk factors for the development of gastric cancer (GC) and pancreatic cancer (PC). The aim of this study is to examine the potential association between the risk of developing GC and PC and the consumption of beverages, fast foods, sweets, fats, and oils. Dietary information was collected from 588 participants, including 173 cases of GC, 101 cases of PC, and 314 controls, matched based on age, gender, employment, and marital status. Structured questionnaires were employed to collect data on dietary intake, physical activity, and socio-demographic factors. The case–control study spanned from March 2015 to August 2017. Multinomial logistic regression was utilized to calculate odds ratios (ORs) along with their corresponding 95% confidence intervals (CIs). Significance was determined at a level of P < 0.05. The findings revealed that high sugar consumption, particularly the intake of sweets such as candies and biscuits, was significantly associated with an increased risk of GC (OR = 1.87, 95% CI = 1.01–3.45, P-value of trend = 0.035) and (OR = 8.52, 95% CI = 3.38–21.43, P-value of trend < 0.001), respectively. Similarly, the intake of candies and Arabic sweets was associated with a higher risk of PC (OR = 2.51, 95% CI = 1.22–5.17, P-value of trend = 0.019) and (OR = 2.11, 95% CI = 1.07–4.15, P-value of trend = 0.002), respectively. Notably, weekly consumption of chicken sandwiches exhibited a positive association with an increased risk of GC (OR = 3.98, 95% CI = 2.20–7.19, P-value of trend < 0.001) and PC (OR = 4.21, 95% CI = 2.19–8.09, P-value of trend < 0.001). Furthermore, the consumption of specific dietary fats, including margarine, processed nuts, pickled olives, and mayonnaise, was higher among PC and GC cases as compared to control. Weekly consumption of processed nuts was associated with a higher likelihood of developing GC (OR = 2.58, 95% CI = 1.29–5.17, P-value of trend = 0.011) and PC (OR = 2.75, 95% CI = 1.20–6.28, P-value of trend = 0.044). We found significant associations between consumptions of candies, biscuits, Arabic sweets, chicken sandwiches, and specific fats and oils with increased risk of PC and GC in Jordanian adults.