Your statement holds if (and only if) every stopping time is predictable; also iff every optional process is predictable. Roughly, the filtration is such that there are no surprises as time passes. I don't know of a direct condition on $X_t$ ensuring this.
Example: Let $T$ be a unit-rate exponential random variable, and define
$$
X_t=\cases{0& $0\le t<T$,\cr t-T,&$t\ge T$.\cr}
$$
The filtration generated by $X$ is the least filtration making $T$ a stopping time. Although $t\mapsto X_t$ is continuous, you can check that the discontinuous process $M_t=1_{\{T\le t\}}-(t\wedge T)$ is a martingale; in fact it is $\Bbb E[Z\mid\mathcal H_t]$ for $Z=1-T$. The "surprise" here is $X$ leaving $0$ at time $T$.