yes, direct management relationships are forbidden in almost all companies for some reason.
If they want to have a relationship, both party MUST talk with the company HR and what is more probably is that one of them is moves to another department, so there is no conflict of interest. Some companies may even kindly request that one of them should leave the company.
Not only it can cause conflict of interest, bad decision and unfair relationship with the other workers, but if they break up, cause even more problem and again problems for the company.
It also depends of the company size, the position of each person and how critical they are, some combination can be OK for the HR, others a huge problem.
For a CEO, that is always a huge problem, how can you make sure that a decision is based on what is better for the company and not for the CEO personal life ?
That is always a problem for normal CEO, much worse for a lover CEO