I'm just wondering, if you have a cardiac pacemaker, can you have a heart attack or go into cardiac arrest?

Yes. The pacemaker will keep functioning with electrical stimuli when the detected pulse is below set rate. Heart attack- muscle death can happen. If it happens at site of pacer contact to heart, the pacer can fail to stimulate.