What happens in the democratic countries if the president's office
orders the electoral commission not to register the opposing candidate
to participate in election?
In a democracy, if the law doesn't disqualify the opposing candidate for some reason, then this order is disregarded, and if it is not disregarded, a court orders the electoral commission to register the candidate.
On the other hand, if the law provides that a candidate isn't eligible to run for office, then the order is followed.
In democracies, the president's power is not absolute and the president can only do those things that the constitution and the laws authorize the president to do. If the president isn't bound by the laws in this way, then the country isn't a democracy.