It's a parody of 犬も歩けば棒に当たる, literally, "Even a dog will find a stick if it walks." It can be interpreted as "No matter what you do, tragedy will befall you," or "Unexpected luck may occur." (That is, the dog may find a bone, or it might walk into a pole.) I opted for a parody of a different English saying, while hopefully keeping it relevant.