SÃO PAULO—Brazil’s election campaign is set to be the country’s most unpredictable in three decades.

Yet, by global standards, it’s following a familiar pattern: the candidate leading the pack has struck a chord with a deeply disillusioned public and is threatening to overturn the political status quo.

Former army captain Jair Bolsonaro...