SEOUL—Just weeks ago, Hong Joon-pyo, the flag-bearer for South Korea’s embattled ruling party, was a rounding error in polls ahead of next month’s presidential election.

But Mr. Hong has found new hope in escalating tensions with North Korea over its nuclear program, a development that has changed the dynamics of the South Korean race. His hard-line policies and his alignment with U.S. President Donald Trump’s aggressive approach to Pyongyang have become increasingly attractive to South Korean voters.