According to current research, there is no definitive evidence that root canals lead to heart attacks or heart disease. However, the reverse may be true: research suggests that heart disease may lead to needing a root canal, and is a potential source of the anecdotal evidence used to support the 'root canal causes heart attacks' idea.
In short: there is evidence that people with heart disease will need a root canal, but not that people who undergo a root canal will get heart disease.
Quick note: what most people call a root canal is actually called endodontic therapy, and a 'root canal' is just a part of a tooth. I'll tend to use the common name for this answer, but may use the proper name where appropriate.
History behind the idea: The idea that a root canal (or any local infection) can cause disease elsewhere in the body started in the early 1900's and was called the focal infection theory. The relevant part of the theory for this question is that endodontic procedures that remove infected tissue from a tooth's root canals could send the bacteria into the bloodstream. This bacteria would eventually reach the heart, and possibly cause problems such as infective endocarditis(warning: gross picture), a type of heart disease.
This theory apparently lost popularity pretty quickly as research supporting the focal infection theory remained minimal as knowledge of infections, antibiotics, and contradicting evidence grew: As an example, today tens of thousands of root canal procedures happen daily, and about 5 cases of infective endocarditis happen yearly.
However, the lack of definitive supporting research hasn't stopped modern critics of root canals from reviving the focal infection theory as well as other alternative theories, such as holistic dentistry. I won't go into too many details about holistic dentistry, but phrases like "knowledge drawn from the world's great traditions" and "deals with the mind, body, and spirit of the patient and not just their 'teeth'" should be all you need to know about it.
Do root canals cause heart attacks?: Getting to the root (pun intended) of the question: there is no definitive evidence that root canals cause heart attacks. This is a review of dozens of studies and books spanning over a century related to this topic. There is far too much to cite here, so I will focus on just the concluding paragraph:
Further research is required to determine whether patients who are systemically ill with RA or PUO and THR patients have a greater incidence of periradicular disease and whether root canal treatment and any subsequent bacteraemia may have adverse effects on these population groups compared to matched healthy cohorts.
Simple summary: more research is needed to prove if certain at risk patients are more likely to have gum disease, and if that correlates with root canals.
There have been no publications to suggest that root canal treatment has any adverse systemic effects since Rogers (1976) and Ehrmann (1977) dismissed any relationship between endodontics and focal infection in review articles.
Simple summary: modern root canal critics have no rigorous research to support their claims, and there is rigorous research to dismiss their claims
With an enhanced awareness amongst the population toward their general health and an increasing concern that disturbance of the periradicular tissues may potentially cause systemic upset, it is necessary to ascertain whether root canal therapy is indeed exacerbating or causing ill health.
Simple summary: if root canals were as dangerous as claimed, people would be much more interested in supporting their research. In other words, researchers would make money and receive a lot of funding if they actually found a connection between root canals and heart disease.
There is currently an international body of dental practitioners who refuse to perform root canal treatment, reciting the research performed 70–80 years ago to justify this stance. However, there is neither recent scientific evidence nor studies to support this view. Further scientific research is required to establish the relationship between pulpally induced or treatment‐fostered periradicular disease and systemic health.
Simple summary: Pretty much just repeats the above. There is no modern evidence supporting the theory, and more research is needed in order to claim a link between undergoing a root canal and having health issues such as heart attacks.
Possible alternative- heart disease leads to root canals: The idea that root canal procedures lead to heart attacks is mainly based on inconclusive, anecdotal evidence that people who underwent a root canal is potentially more likely to have a heart attack. Although there is no evidence to support that root canals cause heart attacks, heart disease certainly leads to heart attacks, and through, well regarded, thorough research suggests a link between heart disease and what causes the need for endodontic therapy.
The Veterans Administration Longitudinal Study of Oral Health and Disease was a study conducted over 30 years which examined the medical health 708 males who were decently healthy at the beginning of the study. Every three years, participants in the study were given complete medical and dental examination in order to find potential links between oral health and diseases. The relevant data for this question is examined in this study, which determined the following:
Among those ≤ 40 years old, incident lesions of endodontic origin were significantly associated with time to CHD diagnosis (p < 0.05), after adjustment for covariates of interest, with hazard ratios decreasing as age increased. Among those > 40 years old, no statistically significant association was observed. These findings are consistent with research that suggests relationships between chronic periodontal inflammation and the development of CHD, especially among younger men.
Simple summary: among older men (>40 years old), there is no definitive link between 'lesions of endodontic origin', i.e. problems that can be treated by endodontic therapy, and coronary heart disease. However, among younger men, endodntic lesions 'were significantly associated with time to CHD diagnosis'.
In other words, among younger men there is a statistically significant change of getting endodontic lesions and needing a root canal after being diagnosed with coronary heart disease.