I'm having this question wrapped around my head for quite some time. The thing is that my main application has a red color theme. And for just cancel buttons I used to use just gray colors but now that I need a "danger" color... What should I use? Purple? Orange? Using the red again is awkward, maybe a darker red?
PD: I cannot use blue because it's our competitors color.
Options to consider:
Red = danger = your app is dangerous. Change the main color of your app to a different color.
Blue = competitor's color. Competitor = dangerous. Use blue for danger.
Use standard colors regardless the main color of your theme. Green = success. Yellow/Orange = Caution. Red = danger/warning. Etc.
Allow user to configure color scheme.
The "danger color" should stand out from the color scheme of your app. It is also good to consider meaning. Red/Orange/yellow, in most cultures, indicates danger, alert, attention. Usually, if I see a blue or green message, I automatically think it is a success feedback. I think you should use an orange or yellow, to stand out from the main colors.
In Google Material Design, they use orange with red themes: https://material.io/design/color/color-usage.html#meaning