It is unlikely that a reviewer or other participant in the peer review process will outright steal the work he/she is reviewing and publish it as original work, because it is easy to get caught.
If the "real" author of the work accuses the thief of plagiarism, the editor of the journal can verify that the work was originally submitted by the "real" author before it was published by the rogue reviewer. (Also see: What to do if a referee plagiarises the result after rejecting a paper?What to do if a referee plagiarises the result after rejecting a paper?)
If the rogue reviewer is caught, the paper will be retracted (which is damaging to his professional reputation) and there may also be other consequences for the reviewer. See e.g. this recent example.