That's a question for you health care team.
There is a lot of variation in humans' maximum heart rates. In one group I used to train with, one of the runners had a heart rate that would go over 200 BPM on long runs. But, for me, 200 BPM was well over my maximum.
For her, 200 BPM was no problem. But, if I had a heart rate that high, I would have needed an ambulance.
Even so, 300 BPM would be frightenly high. It's hard to imagine a healthy human heart beating that fast, but a damaged one might.
If healthy people work extremely hard, such as sprinting as far as possible, their bodies would force them to stop. They would then need a few minutes to "catch their breath" and would not be harmed. During the work period, they would likely reach their maximum heart rate.
But, for people with some heart conditions, working hard can be dangerous. You already know you have a heart condition, so your health care team should have advised you on what activities, and at what intensities, are dangerous for you. If they didn't, you need to ask them.
But, if you have not actually had your heart condition diagnosed, you need to bring that to your physician's attention.
I should ask how do you know your heart rate gets to 180? If you are using a heart rate monitor (HRM), how reliable is it?
I ask because during some of my workouts, my HRM reported a heart rate that was about 2 to 2.5 times my actual heart rate. Other times, it gave a reading that was half to a third of my actual heart rate. Sometimes, it stopped detecting my heart rate. This happened because the chest strap was in poor condition.
By the way, if someone reading this, who is in good health, including heart health, is thinking of sprinting as far as possible, please do a good warmup first. Going from rest to high intensity quickly can be harmful.