On the other hand, if we define $BG$ by the usual simplicial construction, then the functor $B$ does indeed preserve pullbacks. Indeed, if we start with a pullback square $(G,H,J,K)$ then in the corresponding square of simplicial sets, the square of $n$-simplices is just $(G^n,H^n,J^n,K^n)$, which is again a pullback, so we have a pullback square of simplicial sets. It is also standard that the geometric realisation functor from simplicial sets to spaces preserves finite limits, so $(BG,BH,BJ,BK)$ is a pullback of spaces. If the map $H\to K$ is surjective then the map $BH\to BK$ is a fibration and we can conclude that the square $(BG,BH,BJ,BK)$ is also a homotopy pullback. The same applies if the map $J\to K$ is surjective. However, as the other answer explains, this story is not homotopy invariant. It is more usual to consider $BG$ as the name of a homotopy type, and with different models for the relevant homotopy types, the square $(BG,BH,BJ,BK)$ need not be either a pullback or a homotopy pullback.