The answer to the question as asked is negative for certain choices of $f$.

For example, let $d=3$ so that any two distinct nonzero points define a unique hyperplane passing through the origin. Let $B$ be the closed ball of radius $10^{-10}$ around the point $(1,0,0)$. We claim there exist a function $f$ as in the question defined on $B$ which is not measurable. Since the restriction of a measurable function to a measurable set is measurable, it follows that any extension of $f$ to $\mathbb{R}^3$ will be nonmeasurable.

Let $A$ be a nonmeasurable subset of $B$. If $x \in A$, let $f(x)$ be the plane passing through $x$, the origin and the vector $(0,1,0)$. If $x \in B \setminus A$ let $f(x)$ be the plane passing through $x$, the origin and the vector $(0,0,1)$.

Let $P$ be the plane spanned by $(1,0,0)$ and $(0,1,0)$. Let $U$ be the open ball of radius $\frac{1}{10}$ in the Hausdorff metric around intersection of $P$ with the unit ball around the origin. Then we have $f^{-1}(U) = A$, so the claim is established.