To illustrate Hans' (+1) answer:

Extending the integrand by $0$ outside the triangle of integration gives us a function whose Riemann sums we can compute. The darker gray squares represent the contributions where the integrand is given by a piecewise formula (i.e., not by $f(x, y)$ or by $0$). The total contribution from these squares is negligible in the limit as the mesh of the partition goes to $0$.
As for the variable limits of integration, the terms of the Riemann sum where $x < y$ (i.e., the lighter-shaded squares) are zero. We can think of including those terms in the Riemann sum (because $f(x_{i}, y_{j}) = 0$), or we can omit those terms by summing only over the unshaded and darker-shaded squares. Either way, in the limit as the mesh decreases we obtain the stated iterated integral. For each $x$, the integral over $0 \leq y \leq x$ is approximated by the Riemann sum over the blue slice.