It shouldn't matter if the relationship is between a dragon and a zombie, a werewolf and a vampire, a human and an AI, or a golem and a visitor from the planet Zebulon.
But both parties must have informed consent
However, there are many factors of different fictional species that can complicate things significantly.
Awareness/Intelligence
Both parties need to be smart enough to fully understand what they are signing up for with the relationship.
I'll use dragons as an example. In some media, dragons are little more than big reptiles. Mentally the creature is only an animal and does not even understand what a relationship is, therefore any relationship involving it would be disturbing.
However, many forms of media have dragons who are extremely intelligent, sometimes more than humans. If the dragon can have full conversations and is clearly fully aware, then it's fine. (As long as the other criteria are met too)
Age
This is a big one.
As long as both parties are adults or roughly the same age, there's nothing to worry about, but what if one's 25 and the other's 10,000? What if one is mortal and the other is immortal?
If the mortal's an adult, they're old enough to make a decision on their own, but the problem comes from the immortal's side. If they're so old that they could be the mortal's grandmother, then there's a massive difference in the level of maturity between both parties. But a 1,000-year gap? Or more? That's older than most civilizations. It's an uncomfortably wide gap in knowledge and experience.
Another wrinkle is that some species age faster, slower, or maybe even age in reverse. An immortal species might age so slowly that 10,000 is 13 to them, or they age so fast that they go through an entire life cycle in a day.
If you're gonna go down the immortal x mortal with a large age gap route, at least make it clear the immortal is mentally as old as the mortal. (e.g. they age 400 times slower than humans so one of them reaching 10,000 puts them at an equivalent mental age to a human being at 25).
Communication
Okay, so now you've established that all parties are beings old enough and intelligent enough to fully understand what a relationship is, but there's still another hurdle to cross.
How do the two communicate? If one is a human and the other is an eldritch god, how do they understand each other?
Eldritch gods might only speak through dreamlike images or visions. Humans speak through words, writing, or body language. If they can't meaningfully communicate, there's no relationship to be had.
Worse yet, one party might have a completely incorrect idea about what the other one wants.
For example, the eldritch god might know what sex is, but they might not know why humans do it. It's a foreign concept to them because human anatomy's utterly alien to them.
In the same way, if your boyfriend Cthulu asks you to sgsdfhksldfhewriewrew him, you'll have no idea what that means because you don't speak Primordial and you might not be able to.
Both parties need something to work with, some common ground for the relationship to flourish. Maybe the human doesn't know Primordial but at least they try.
Dependence/Freedom to Choose
A relationship should always be a choice, but some tropes in fiction make it very hard for one party to have a choice.
In sci-fi, a good example would be a robot and a creator. You program a robot to fall in love with you and be your loving wife. But if the robot is bound by her programming and can't help loving you, or you have a remote you control them, then they have no choice in the matter.
Imagine the robot's perspective. They're a prisoner both mentally and physically. Forget romance, that's the start of a horror film.
In fantasy, the trope would be roughly the same. You build a monster or make a contract with a demon, and they're bound to do whatever you say, but that's not a healthy relationship because you have incredible power over the other party. They're your servant.
If you're going to make a robot wife or get a demon contractor, they should still be there by choice, not because you forced them to be here.
The same thing works in the reverse.
When your character's dating an all-powerful demon lord, they shouldn't be there because the demon lord put them under a powerful spell that forbids them from leaving. That's horror, not romance.
When your character is dating an omniscient AI, they shouldn't be there because the robot blocked off all the exits and will vaporize them if they try to leave.
My point is, try not to create unhealthy power imbalances.
If one partner's a normal mortal and the other's a world-ending god powerful enough to kill the other with a single touch, the god had better treat their sweetheart with exceptional gentleness and affection for the relationship to be healthy.