They can't be "depended upon" to work, but those examples have had their code generated carefully examined to ensure that they do work.
Several of the examples are also in the .init3 section, which executes essentially before C is set up, so they're somewhat free to do what they want. Some other examples use statements that are 'well known' to not interfere with system state (calls to other void functions generate simple "call" statements, reti() is an intrinsic for the reti instruction, etc.)
PORTB |= _BV(0); // results in SBI which does not affect SREG
in example 6 Is particularly dangerous; while that statement results in a single SBI instruction that doesn't affect registers or flags, a similar statement with a different port might not: