If balls are replaced with rectangles, does Lebesgue's differentiation theorem hold? I know that the Lebesgue's differentiation theorem states that for $f\in L^1(\mathbb R^n)$ then
$$\lim_{r\to 0^+}\frac1{B_r(x)}\int_{B_r(x)}f$$
exists and coincides with $f(x)$ a.e.
I am wondering whether balls can be replaced with rectangles.
To be precise, if $f\in L^1(\mathbb R^n)$, does
$$\lim_{r_1,\dots,r_n\to 0^+}\frac1{r_1\cdots r_n}\int_{[x_1-r_1/2,x_1+r_1/2]\times\cdots\times[x_n-r_n/2,x_n+r_n/2]}f$$
exist and coincide with $f(x)$ a.e.
I have found the following more general results of Lebesgue's differentiation, but it seems to be not applicable in our current case.
So I guess the answer is no.
But I cannot find any example.

Let $\mathcal {V}$ be any family with the property that
(i) for some $c > 0$, each set $U$  from the family is contained in a ball $B$  with $ |U|\geq c\cdot |B|$;
(ii) every point $x\in\mathbb R^n$ is contained in arbitrarily small sets from ${\mathcal {V}}$.
Then the analogous limit exists and coincides with $f(x)$ a.e. as the sets $U$ shrink to $x$.
So, for example, if we let $Q_r(x)$ denotes the cube centered at $x$ with diameter $r$, then
$$\lim_{r\to 0^+}\frac1{Q_r(x)}\int_{Q_r(x)}f.$$
exists and coincides with $f(x)$ a.e.

Thanks!
 A: Big topic, not to be approached timidly.
The shortest answer is that for rectangles with sides parallel to the axes (usually called intervals) it works for bounded integrable functions but not otherwise in general.  If you allow the rectangles to have different orientiations then it fails really badly.
Everything I learned about this was due to reading the excellent survey article by Andy Bruckner that he published as a  HERBERT ELLSWORTH SLAUGHT MEMORIAL PAPER in the Monthly back in 1971.

Differentiation of Integrals, Andrew M. Bruckner
The American Mathematical Monthly, Nov., 1971, Vol. 78, No. 9, Part 2:
Differentiation of Integrals (Nov., 1971), pp. i-iii+1-51
Published by: Taylor & Francis, Ltd. on behalf of the Mathematical
Association of America
Stable URL: https://www.jstor.org/stable/3072337

Here is a crude account of the motivation presented there.  Interpret the differentiation of integrals question this way and stay in $\mathbb R^2$ for the moment:
$$ \lim_{I \implies x} \frac{1}{\mu(I)} \int_I f(x)\,d\mu(x) = f(x) \ \ a.e.  ? \tag{#}$$
Here $I\implies x$ is   something like balls shrinking to $x$, or squares,  or intervals, or rectangles etc.  Stay with $\mu$ as Lebesgue measure too.
Here is how Andy introduced the problem:
"That being the case, the situation is as follows. If we take $\cal J$  to be the family of disks or squares (in which case differentiation relative to ($\cal J$, $\implies$) is often called ordinary differentiation), then  (see the theorem of Section 2.1) holds for all locally summable f [95], [137], [144]. If we take $\cal J$ to be the family of two dimensional intervals (in which case differentiation relative to ($\cal J$, $\implies$.) is called strong differentiation, then (#)  holds for all bounded summable f, (and some other functions), but not for all summable functions [95], [144]. Finally, if we take the family  of all rectangles, then (#) does not even hold for all bounded summable f. In fact, (#) does not even hold for all characteristic functions of open sets [21]. What is it that causes these differences? This question can be answered at various levels. To understand the differences fully, one must understand the proofs and counterexamples required to justify the statements. But, short of going into the necessary details, let us try to give some sort of indication of ..."

REFERENCES:     If you can download a copy of Andy's survey, that is an excellent introduction to these ideas with a rich account of the history and many references. For a detailed textbook account of part of this theory see Chapter 8, Differentiation of Measures in this reference [1]. Another reference that I used and studied is [2] by Miguel de Guzmán.
[1]  http://classicalrealanalysis.info/documents/BBT-AlllChapters-Landscape.pdf
[2] https://link.springer.com/book/10.1007/BFb0081986
