This paper investigates the value function, $V$, of a Mayer optimal control problem with the state equation given by a differential inclusion. First, we obtain an invariance property for the proximal and Fr\'echet subdifferentials of $V$ along optimal trajectories. Then, we extend the analysis to the sub/superjets of $V$, obtaining new sensitivity relations of second order. By applying sensitivity analysis to exclude the presence of conjugate points, we deduce that the value function is twice differentiable along any optimal trajectory starting at a point at which $V$ is proximally subdifferentiable. We also provide sufficient conditions for the local $C^2$ regularity of $V$ on tubular neighborhoods of optimal trajectories.