Recent studies have suggested an increased incidence of myocarditis and pericarditis following mRNA vaccination or COVID-19. However, the potential interaction effect between vaccine type and COVID-19 on heart disease risk remains uncertain. Our study aimed to examine the impact of COVID-19 status and vaccine type following the first dose on acute heart disease in the Korean population, using data from the National Health Insurance Service COVID-19 database (October 2018–March 2022). We sought to provide insights for public health policies and clinical decisions pertaining to COVID-19 vaccination strategies. We analysed heart disease risk, including acute cardiac injury, acute myocarditis, acute pericarditis, cardiac arrest, and cardiac arrhythmia, in relation to vaccine type and COVID-19 within 21 days after the first vaccination date, employing Cox proportional hazards models with time-varying covariates. This study included 3,350,855 participants. The results revealed higher heart disease risk in individuals receiving mRNA vaccines than other types (adjusted HR, 1.48; 95% CI, 1.35–1.62). Individuals infected by SARS-CoV-2 also exhibited significantly higher heart disease risk than those uninfected (adjusted HR, 3.56; 95% CI, 1.15–11.04). We found no significant interaction effect between vaccine type and COVID-19 status on the risk of acute heart disease. Notably, however, younger individuals who received mRNA vaccines had a higher heart disease risk compared to older individuals. These results may suggest the need to consider alternative vaccine options for the younger population. Further research is needed to understand underlying mechanisms and guide vaccination strategies effectively.