This is a somewhat interesting point. replacement after integration results in 1 because the result of the integration is a UnitStep, which has a defined value at the point where the DiracDelta has an undefined value, as a generalized function when discussed outside the integral. Replacement before integration results in 0,apparently because the integration is formally over the open interval, which well might agree with integration theory.

It is interesting to note that Mathematica uses the UnitStep as the antiderivative for DiracDelta, but uses the DiracDelta as the derivative of the HeavisideTheta. If the integration of the DiracDelta resulted in the HeavisideTheta, then in the case where replacement occured after integration, the integral would be undefined at the endpoint of the interation limit. I suspect this interesting inconsistency is needed so that in general the integral of functions containing the DiracDelta are defined everywhere, which they should be. This is probably related to questions like "How many angels can dance on the head of a pin?"

In[11]:= Integrate[

DiracDelta[x - a, y - b], {x, 0, 1}, {y, 0, 1}] /. {a -> 1, b -> 1/2}

Out[11]= 1

In[12]:= out =

Integrate[DiracDelta[x - a, y - b], {x, 0, 1}, {y, 0, 1}]

Out[12]= ConditionalExpression[

UnitStep[1 - a] UnitStep[a] UnitStep[1 - b, b], a \[Element] Reals]

In[13]:= out /. {a -> 1, b -> 1/2}

Out[13]= 1

In[14]:= Integrate[DiracDelta[x - 1, y - 1/2], {x, 0, 1}, {y, 0, 1}]

Out[14]= 0