The answer is negative. HereIn fact, let us show that $a_n$ as defined in the question may converge to $0$ however slowly. Indeed, let $(\epsilon_j)$ is a counterexampleany sequence in $(0,1]$ converging to $0$ slowly and regularly enough, in the sense that \begin{equation} \epsilon_{j-1}-\epsilon_j\ge2^{2-j}\tag{1} \end{equation} eventually in $j$ -- that is, for some natural $j_0$ and all natural $j\ge j_0$. For naturalinstance, this condition will hold if $\epsilon_j$ is (eventually in $j$) of the form $2^{2-j}$ or $j^{-a}$ or $(\underbrace{\ln\dots\ln}_N j)^{-a}$ for some real $a$ and some natural $N$.
In what follows, let$j$ is a natural number $\ge j_0$.
$$k_j:=\lfloor2^j/j\rfloor$$Let
$$k_j:=\lfloor2^j\epsilon_j\rfloor$$
and
$$r_j:=k_j/2^j.$$ Then $\frac1j-\frac1{2^j}<r_j\le\frac1j$ and
\begin{equation}
\epsilon_j-\tfrac1{2^j}<r_j\le\epsilon_j\tag{2}
\end{equation}
and hence, by the regularity condition $r_j$ is decreasing in$(1)$, $j\ge5$$r_j<r_{j-1}$. Let $$\Delta_j:=(r_{j},r_{j-1}].$$ Here $j\ge6$ is a natural number.
Note that the intervals $\Delta_j$ are pairwise disjoint.
Let then
$$s_{j,\ell}:=r_{j}+\ell/2^{j+1}$$
for $\ell=0,\dots,\ell_j:=(r_{j-1}-r_{j})2^{j+1}$, so that $\ell_j$ is even, and
$$\delta_{j,\ell}:=(s_{j,\ell},s_{j,\ell+1}].$$
Note that
$\Delta_j$ is the disjoint union of the $\delta_{j,\ell}$'s over $\ell=0,\dots,\ell_j-1$.
Let, finally,
\begin{equation}
B:=\bigcup_{j=6}^\infty\bigcup_{q=0}^{\ell_j/2-1}\delta_{j,2q}.
\end{equation}\begin{equation}
B:=\bigcup_{j=j_0}^\infty\bigcup_{q=0}^{\ell_j/2-1}\delta_{j,2q}.
\end{equation}
Take now any large enough natural $n$. Let \begin{equation} H_{n,i}:=\Big(\frac i{2^n},\frac{i+1}{2^n}\Big] \end{equation} for $i=0,\dots,2^n-1$.
From now on, suppose also that $j\in\{n,\dots,2n\}$$j\ge n\ge j_0$.
Note also thatThen $|\delta_{j,\ell}|=1/2^{j+1}<1/2^n=|H_{n,i}|$, given the condition $j\in\{n,\dots,2n\}$, where $|\cdot|$ denotes the Lebesgue measure.
For any given $i=0,\dots,2^n-1$ such that $H_{n,i}\subseteq\Delta_j$, we have
$$B\cap H_{n,i}=\bigcup_{q=q_1}^{q_2}\delta_{j,2q}
\quad\text{and}\quad
H_{n,i}=\bigcup_{\ell=2q_1}^{2q_2+1}\delta_{j,\ell}$$
for some integers $q_1=q_{1;n,i}$ and $q_2=q_{2;n,i}$ such that $0\le q_1\le q_2\le\ell_j/2-1$.
Hence,
$|B\cap H_{n,i}|=\frac12|H_{n,i}|=\frac12\frac1{2^n}$.
So,
\begin{equation}
\frac{|B\cap H_{n,i}|}{2^{-n}}\Big(1-\frac{|B\cap H_{n,i}|}{2^{-n}}\Big)
=\frac14
\end{equation}
-- for each $j\in\{n,\dots,2n\}$$j\in\{n,n+1,\dots\}$ and each $i=0,\dots,2^n-1$ such that $H_{n,i}\subseteq\Delta_j$.
Note here thatBy $(2)$ and $(1)$, the length $|\Delta_j|$ of the dyadic interval $\Delta_j$ is $\asymp\frac1{j^2}$
$r_{j-1}-r_j\ge\epsilon_{j-1}-\epsilon_j-\tfrac1{2^{j-1}}\ge\tfrac12\,(\epsilon_{j-1}-\epsilon_j)$, and
and so, for a given natural $n$$n\ge j_0$, the dyadic interval $\Delta_j$ contains at least
$c \frac{2^n}{j^2}$$2^{n-1}(\epsilon_{j-1}-\epsilon_j)$
dyadic intervals $H_{n,i}$, for some universal real constant $c>0$.
So, for $a_n$ as defined in the question, we have
\begin{equation}
a_n\ge\frac1{2^n}\sum_{j=n}^{2n}\ \sum_{i\colon H_{n,i}\subseteq\Delta_j}
\frac{|B\cap H_{n,i}|}{2^{-n}}\Big(1-\frac{|B\cap H_{n,i}|}{2^{-n}}\Big)
\ge
\frac1{2^n}\sum_{j=n}^{2n}c\frac{2^n}{j^2}\frac14\asymp\frac1n,
\end{equation}\begin{equation}
a_n\ge\frac1{2^n}\sum_{j=n}^\infty\ \sum_{i\colon H_{n,i}\subseteq\Delta_j}
\frac{|B\cap H_{n,i}|}{2^{-n}}\Big(1-\frac{|B\cap H_{n,i}|}{2^{-n}}\Big)
\ge
\frac1{2^n}\sum_{j=n}^\infty 2^{n-1}(\epsilon_{j-1}-\epsilon_j)\frac14
=\frac{\epsilon_{n-1}}8.
\end{equation}
which yields $\sum_n a_n=\infty$.
Starting withThus, $k_j:=\lfloor2^j\epsilon_j\rfloor$ instead of$a_n\ge\frac{\epsilon_{n-1}}8$ for all $k_j:=\lfloor2^j/j\rfloor$$n\ge j_0$.
For instance, whereletting $(\epsilon_j)$ is any sequence of positive numbers converging to$\epsilon_j=1/j$ for all natural $0$ slowly and regularly enough$j$, we can similarly conclude that $a_n$ can go to $0$ however slowlyhave
$\sum_n a_n=\infty$.