The dimension of tensor products of k-algebras arising from pullbacks