One knows that $P(S_n,n)$ is a martingale iff $P(s+1,n+1)+P(s-1,n+1)=2P(s,n)$ and $Q(B_t,t)$ is a martingale iff $2\partial_tQ(x,t)+\partial^2_{xx}Q(x,t)=0$.
Assume that $P(S_n,n)$ is a martingale and, for a given $d$ and for every $h>0$, let $$ Q_h(x,t)=h^{d}P(x/\sqrt{h},t/h), $$ in the sense that one evaluates $P(s,n)$ at the integer parts $s$ and $n$ of $x/\sqrt{h}$ and $t/h$.
If $Q_h\to Q$ when $h\to0$, writing $\partial_t$ and $\partial^2_{xx}$ as limits of finite differences of orders $1$ and $2$, one sees that $2\partial_tQ+\partial^2_{xx}Q=0$, hence $Q(B_t,t)$ is a martingale.
Example: $P(s,n)=s^2-n$. For $d=1$, $Q_h(x,t)=x^2-t$ hence $Q(x,t)=x^2-t$.
Other example: $P(s,n)=s^4-6ns^2+3n^2+2n$. For $d=2$, $Q_h(x,t)=x^4-6tx^2+3t^2+2ht$ hence $Q(x,t)=x^4-6tx^2+3t^2$.
In the other direction, to deduce a martingale in $S_n$ and $n$ from a martingale in $B_t$ and $t$, one should probably replace each monomial by a sum of its first derivative. Something like replacing $q(t)=3t^2$ by $\displaystyle\sum_{k=1}^n(\partial_tq)(k)=3n^2+3n$...