  It is known that in some higher-order topological insulators (HOTIs),
topological phases are distinguished not by gap closings of bulk states but by
those of edge states, which are called boundary-obstructed topological phases
(BOTPs). In this paper, we construct an effective theory of the BOTP transition
of two-dimensional (2D) Su-Schrieffer-Heeger (SSH) model in a uniform magnetic
field. At $\pi$ flux per plaquette, this model corresponds to the typical model
of HOTIs proposed by Benalcazar, Bernevig, and Hughes (BBH). The BBH model can
be approximated by Dirac fermions with two kinds of mass terms, which will be
referred to as BBH Dirac insulator. To clarify the BOTP transition of the 2D
SSH model around $\pi$ flux, we study such BBH Dirac insulator in the presence
of a magnetic field. On the other hand, generically in continuum Dirac models,
boundary conditions associated with the Hermiticity of Hamiltonians are known
to play a crucial role in determining the edge states. We first demonstrate
that for the conventional Dirac fermion with a single mass term, such boundary
conditions indeed determine the edge states even in the presence of a magnetic
field. Next, imposing boundary conditions consistent to the lattice
terminations and symmetries of the BBH Hamiltonian as well as to the
Hermiticity of the BBH Dirac insulator, we obtain the edge states of the BBH
Dirac insulator in a magnetic field and reproduce its BOTP transition. In
particular, we show that the unpaired Landau levels, which cause the spectral
asymmetry, yield the edge states responsible for the BOTP transition.
