Question
Let $S \subset \mathbb R^d$ be compact and $f : S \to \mathbb R$ be continuous (hence uniformly continuous) on $S$. A function $\omega : (0,\infty) \to (0,\infty)$ is called a modulus of continuity for $f$ if, for all $\epsilon>0$,$$ \|x-y\| < \omega(\epsilon) \implies |f(x)-f(y)| < \epsilon, \text{for all } x,y \in S. $$ In other words, $\delta = \omega(\epsilon)$ satisfies the $\epsilon-\delta$ of uniform continuity for $f$. Furthermore, as illustrated by a counterexample in the comments, we insist that $\lim_{\epsilon \to 0} \omega(\epsilon) =0$.
Suppose that $S \subset \mathbb R^d$ is compact and $f : S \to \mathbb R$ admits a modulus of continuity $\omega$ on $S$. Does there exist a function $g : \mathbb R^d \to \mathbb R$ such that (a) $g(x) = f(x)$ on $S$, and (b) $g$ is uniformly continuous on $\mathbb R^d$ with modulus of continuity $\omega$? We can possibly relax the modulus of continuity of $g$ to be of the form $C \times \omega$ for any $C>0$ positive, but not more than that.
Motivation
In order to motivate this question, it helps to look at other extension theorems.
Given $f : O \to \mathbb R$ uniformly continuous on an open set $O$, it admits a unique extension to $\overline{O}$ which is also uniformly continuous. The proof technique is to define $\tilde{f}(x) = \lim_{y \to x, y \in O} f(y)$ and show that this works.
Given any $f : S \to \mathbb R$ continuous where $S$ is closed, it admits a continuous extension to $\mathbb R^d$. This follows directly from the Tietze extension theorem.
If we assume that the modulus of continuity has a specific structure, then some results are known. See e.g. the Kirszbraun Theorem for Lipschitz moduli of continuity i.e. $\omega(\epsilon) = C\epsilon$ for some $C>0$. Here's a nice proof of that result.
What makes this particularly difficult to approach is the control of the modulus of continuity of $g$ outside the set $S$. For example, suppose that we naively try to force $g$ to be constant outside an open set $O$ which contains $S$, so that its modulus of continuity is controlled on $O^c$. Certainly we can find a function $g$ such that $g \equiv f$ on $S$ and $g \equiv 0$ on $O$, by a variation of Tietze's theorem. However, what we can't do using that scheme is control $|g(x)-g(y)|$ in the region between $S$ and $O$. That's what makes this question interesting.