Hausdorff dimension of the non-differentiability set a convex function Let $X \subset \mathbb R^d$ be open, $f : X \to \mathbb R$ and
$$
E := \{x \in X : f \text{ is not Fréchet differentiable at }x\}.
$$
Then we have the following result which is

Theorem: If $X= \mathbb R^d$ and $f$ is convex, then the Hausdorff dimension of $E$ is at most $d-1$.

Differentiability is a local property, so I guess above theorem is true even though $X \neq \mathbb R^d$. Can we extend above theorem to obtain below one?

If $X$ is convex and $f$ is convex, then the Hausdorff dimension of $E$ is at most $d-1$.

 A: I just stumbled across your question. I have no idea how the proofs of these results go—and I am inclined to believe that they would indeed also prove the version you seek—but here's a way to deduce the local result from that on $\mathbf{R}^d$.
Let $X \subset \mathbf{R}^d$ be an open, convex set, $f: X \to \mathbf{R}$ be a convex function, and $E \subset X$ be the set of points where $f$ is not differentiable.
In general $f$ cannot be extended to a function defined on $\mathbf{R}^d$. However, if it were bounded and Lipschitz, then it could be [Thm. 4.1,Yan12]. Indeed, under these assumptions the extension $\bar{f}: \mathbf{R}^d \to \mathbf{R}$ can be defined by setting
\begin{equation}
\bar{f}(z) := \operatorname{sup} \{ t f(x) + (1-t) f(y) \mid x,y \in X, t \geq 1, z = t x + (1-t) y \}
\end{equation}
for all points $z \in \mathbf{R} \setminus X$.
Let $x \in X$, and $r > 0$ be so small that $D_r(x) \subset \subset X$. Write $f_{x,r}: D_r(x) \to \mathbf{R}$ for the restriction of $f$ to this disk. As convex functions are locally Lipschitz, $f_{x,r}$ is Lipschitz and bounded, and we may thus extend it to $\bar{f}_{x,r} :\mathbf{R}^d \to \mathbf{R}$.
The global version gives that the Hausdorff dimension of $E \cap D_r(x)$ is at most $d-1$. The conclusion follows after covering $X$ with a countable collection of such disks.
A: This is true and it follows from the following result:

Lemma. Suppset that $f:W\to\mathbb{R}$ is convex and $L$-Lipschitz, where $W\subset\mathbb{R}^n$ is convex. Then,
$$
\tilde{f}(x)=\inf_{z\in W}\, \big(f(z)+L|x-z|\big),
\quad x\in\mathbb{R}^n
$$
is convex and $L$-Lipschitz on $\mathbb{R}^n$, and $\tilde{f}=f$ on $W$.

Now you can exhaust $X$ by compact convex subdomains $W_k\Subset X$, $X=\bigcup_k W_k$. Then $f$ is convex and Lipschitz on $W_k$. Extend $f$ from $W_k$ to a convex function $\tilde{f}_k:\mathbb{R}^n\to\mathbb{R}$, $\tilde{f}_k=f$ on $W_k$, and apply the result you mention to each of the functions $\tilde{f}_k$.
The above lemma is well known and you can find it for example in:
D. Azagra, P. Hajłasz,
Lusin-type properties of convex functions and convex bodies.
J. Geom. Anal. 31 (2021), 11685–11701.
The theorem about the size of the set of non-differentiablity points of a convex function is actually due to  Zajíček who proved a much stronger result is 1979. For comments and references, see https://mathoverflow.net/a/354985/121665.
