It’s probably safe - if you make sure the grain of the wood is aligned perpendicularly to any small pressure points - for example, the recommended jack points on most cars. Otherwise, it’s at risk of splitting, which would result in the car falling the height of the wood, and perhaps more. Some pieces of wood could have structural vulnerabilities - do this with due caution.
The exception is if the pressure is evenly distributed along the piece, like @Paulster2’s photo shows - that’s ok.
While it has to be wider than it is tall, it should be thick enough too, especially if the weight is bearing down on a small area. I agree that in the picture in the OP, it is not thick enough. A 2x4 would be good, or 3x6, or 2x6. I would avoid 2x2 and even 4x4. Obviously for the same reason, the longer side needs to be the side in contact with the jack stand and car...
Of course finally: you do this at your own risk; I’m not responsible for any damages incurred from following this advice. This is merely a description of what I myself have done, and the logic behind how it was done.