Let $f$ be a continuous bounded function. $X$ is a Feller process, and $\hat X$ is its Cadlag modification. By the definition of the modification, one can write $$\mathbb E[f(X_t)] = \mathbb E[f(\hat X_t)], \ \forall t>0$$ I wonder if it is safe to generalize the above identity to a hitting time. More precisely, we define exit time for an open set $O$ by $$\tau = \inf\{t\ge 0: X_t \notin O\}, \ \hat \tau = \inf\{t\ge 0: \hat X_t \notin O\}.$$

[Q.] Is $\mathbb E[f(X\tau)] = \mathbb E[f(\hat X_{\hat \tau})]$ true? If not, is there any counter-example?

I guess it is true and very fundamental result, since many papers on stochastic processes start with problem setup on the modification process without further discussion. For instance, at the beginning of Section III.3 of the book [D Revuz and M. Yor] of strong Markov property, they write:

"We shall consider the canonical Cadlag version of a Feller process..."

Discussion 1: However, most references discuss only the existence of such a version, but not the above question.

Discussion 2: By adopting the definition Feller process given by Page 88 of book, the existence of Cadlag modification is guaranteed by section III.2 of the book [D Revuz and M Yor].