Sonoff switch with override wall switch
I would hesitate to give a definitive answer to this because it's obvious in your circuit that when S1 is ON and S2 is OFF then you are connecting mains to the output of Sonoff 1 with no connection to it's input.

However, I have checked my own Sonoff (Basic R2) and the input line is switched to the output by a mechanical relay with no other connection to the output so I can see no reason why this wouldn't be perfectly safe. Worth checking yours is the same though as other versions may be different.