There are risk factors for heart attacks beyond a sedentary lifestyle and for some people, no amount of exercise can overcome those. Things like high cholesterol and high blood pressure can be the dominant factors leading to a heart attack. Plus, as your friend possibly experienced, the symptoms may be non-existent or easy enough to ignore.
See your doctor, get tested, and reduce those risk factors.