We compute, in topological terms, the spectral flow of an arbitrary family of self-adjoint Dirac type operators with classical (local) boundary conditions on a compact Riemannian manifold with boundary under the assumption that the initial and terminal operators of the family are conjugate by a bundle automorphism. This result is used to study conditions for the existence of nonzero spectral flow of a family of self-adjoint Dirac type operators with local boundary conditions in a two-dimensional domain with nontrivial topology. Possible physical realizations of nonzero spectral flow are discussed.