...but the Stride is the number of bytes that are being used to store one row of pixel data. The example is only wrong in that setting every third value to 255 will not produce a meaningful result since the Stride may include padding bytes as described.
The example technically works in that it shows how to use LockBits to manipulate bitmaps directly, but it's "wrong" in that the example code itself isn't terribly useful.
It should also be noted that every PixelFormat has a different pixel data format so this example is also a bit misleading... you should explicitly pass a specific PixelFormat value to LockBits, (or at least check the bitmap's PixelFormat) otherwise you could end up reading/writing in the wrong format if you LockBits on a bitmap that isn't in the format you expect or suppot. Passing a specific value causes an exception if you accidentally try to operate on a bitmap in this case.