Yes, it is okay and correct to say that.
due to X means because of X, so X is the reason for something. Because you're describing a reason, you need something that functions as a noun. "Coming from a poor family" can function as a noun, such as in the following sentences:
Coming from a poor family gave John a keen appreciation for hard work.
There is no shame in coming from a poor family.
Mary's success in the business world shows that coming from a poor family doesn't mean you can't achieve great things.
How that we've seen that "coming from a poor family" can function as a noun, let's do a little experiment and actually replace it with a noun - e.g. "circumstances". Whose circumstances are we talking about? Her circumstances. So if we now undo the substitution we made, we end up with her coming from a poor family.
Plugging that back into the original sentence you provided, you get:
The king didn't approve of her relationship with the prince due to her circumstances.
↓
The king didn't approve of her relationship with the prince due to her coming from a poor family.