As far as I know, the only "international code of ethics" in this regard is that all authors must agree on the author ordering, or the paper cannot be published.
Who will decide who the first author will be? I am talking about a scenario when all the co-authors are PhD holders. If there is a dispute, who has to resolve and how?
If there is a dispute, they have to negotiate until they find an ordering that everyone agrees with. Nobody has the right to put your name in a certain position without the consent of you and all the other authors. (It is irrelevant here who holds a PhD or not; the authors have the same rights no matter what kind of degrees they have or don't have.)
If the authors can't reach agreement, they can't publish the paper. A subset of the authors could decide instead to publish a new paper with the remaining authors' contributions removed or recreated from scratch.
Of course, the authors could agree that they are going to let a certain person decide (the corresponding author or whoever), and that they will follow that person's decision.
Commonly, the journal will require every author to sign a statement (or click a check box) that they approve all aspects of the submitted paper, including the author ordering. So if anyone disagrees with the ordering, they withhold consent and the paper doesn't proceed until agreement is reached. Or, in some cases, the corresponding author is asked to certify that all authors consent. It would be extremely unethical for them to certify this if the authors do not all agree to the author ordering.
Who decides the sequence of co-authors in the manuscript, first author or corresponding author? Is there any international code of ethics in this regard?
Again, we have to assume that it is practically impossible to quantify the contributions of respective co-authors in a well-funded, well-qualified research group. And qualification sometimes comes along with ego. How can the corresponding author decide that the second co-author has contributed more than the third co-author, and the ordering will not change (whosoever had decided based on point 2)?
As above, the corresponding author can't make any such decision unilaterally.