It's impossible to say without knowing the cause. If it was a cardiac arrest as seems apparant by the pitchside CPR, there are multiple potential underlying factors. Among young athletes, dilated cardiomyopathy is the leading cause of cardiac arrest, but there are other conditions that can cause it, such as Brugada syndrome. To answer your question, there is screening available for HCM and most footballers are regularly tested for it. I believe there has been a major push for extensive testing since Fabrice Muamba's collapse in 2012.
Also, I've noticed in here and on Twitter people have been confusing heart attacks with cardiac arrest, they are not the same thing.
A heart attack is cardiac distress typically caused by blocked arteries. A cardiac arrest however is caused by a problem in the heart's electrical system, causing sudden cessation of heart function, loss of breathing and consciousness.
Heart attacks patients tend to remain conscious and breathing, and while heart attacks are often fatal, cardiac arrests are much more deadly and tend to have a much higher mortality rate.
Reassuring to hear Eriksen is stable, what a terrible time for him and his family.