First off I'm sorry you are having nightmares.
I actually asked my cardiologist about this, because I already have a heart condition. He said that for me, he didn't think it was harmful. He said I should take my pulse when I wake up and make sure it recovers quickly. I find that this actually helps me calm down. It gives me something else to concentrate on. He said that my pounding heart from the nightmares is the same as when I go running. Not harmful.
I would check with your cardiologist about it because your condition is a lot different than mine. I'm sure its probably nothing to worry about, but it can't hurt to check.