You need the last term in the set {-4,...,0.75-\x}
to be evaluated before the code tries to read it in setting up the loop. There are different ways to do this. One is to use pgf's evaluate
option,
\foreach \i [evaluate=\i as \k using 0.75-\i] in {0,0.25,...,4.75}
{
\foreach \j in {-4,-3.75,...,\k}
\filldraw[draw=black, fill=blue,opacity=0.2] (0,\j) rectangle (0.25,\j+0.25);
}
This results in the following image.

I'm not quite sure what the result is meant to look like. The opacity=.2
is effective, but if you layer enough blobs of 20% opacity one on top of another, they no longer look opaque.
To see this, try shifting the blocks rather than painting them one on top of another each time you iterate through the loop. For example,
\foreach \j in {-4,-3.75,...,\k}
\filldraw[draw=black, fill=blue,opacity=0.2] (\i,\j) rectangle (\i+0.25,\j+0.25);
produces

Or perhaps you'd like the opacity to be applied to the result of the two loops,
\begin{scope}[transparency group,opacity=.2]
\foreach \i [evaluate=\i as \k using 0.75-\i] in {0,0.25,...,4.75}
{
\foreach \j in {-4,-3.75,...,\k}
\filldraw[draw=black, fill=blue] (0,\j) rectangle (0.25,\j+0.25);
}
\end{scope}

But you may also be hoping for some other image I've not managed to guess ;).
Complete code:
\documentclass[tikz]{standalone}
\begin{document}
\begin{tikzpicture}
\foreach \i [evaluate=\i as \k using 0.75-\i] in {0,0.25,...,4.75}
{
\foreach \j in {-4,-3.75,...,\k}
\filldraw[draw=black, fill=blue,opacity=0.2] (0,\j) rectangle (0.25,\j+0.25);
}
\end{tikzpicture}
\begin{tikzpicture}
\foreach \i [evaluate=\i as \k using 0.75-\i] in {0,0.25,...,4.75}
{
\foreach \j in {-4,-3.75,...,\k}
\filldraw[draw=black, fill=blue,opacity=0.2] (\i,\j) rectangle (\i+0.25,\j+0.25);
}
\end{tikzpicture}
\begin{tikzpicture}
\begin{scope}[transparency group,opacity=.2]
\foreach \i [evaluate=\i as \k using 0.75-\i] in {0,0.25,...,4.75}
{
\foreach \j in {-4,-3.75,...,\k}
\filldraw[draw=black, fill=blue] (0,\j) rectangle (0.25,\j+0.25);
}
\end{scope}
\end{tikzpicture}
\end{document}
EDIT
If I wanted the second image (but less a square), I'd do something more like this,
\begin{tikzpicture}[x=2.5mm,y=2.5mm]
\foreach \i [evaluate=\i as \k using int(19-\i)] in {0,...,19}
{
\foreach \j in {0,...,\k}
\filldraw[draw=black, fill=blue,opacity=0.2] (\i,\j) rectangle ++(1,1);
}
\end{tikzpicture}

This involves fewer calculations, is easier to understand and will produce a more accurate result (because calculating with decimals introduces imprecision, though the accumulation probably doesn't matter here).
\fpeval{...}
. To ensure we are on the same page, you should type in\foreach \y in {-4,-3.75,...,\ fpeval{0.75 - \x}}
.texdoc interface3
nortexdoc source3
.