Interplay between boundary conditions and Wilson's mass in Dirac-like Hamiltonians