Generally, cockroaches are not a threat to dogs and cats and they will avoid them in most circumstances just like they avoid humans.
Cockroaches view cats and dogs as a threat to their existence that are better off avoided, so they usually run and hide when they detect the movement of one these animals.
In extreme circumstances where there is a large infestation of cockroaches, however, it is not unknown for cats and dogs to suffer cockroach bites.
When the available food is in short supply and there is a large population of cockroaches, they will risk approaching a dog or cat in order to eat food remnants off of the skin of the animal, which sometimes results in bites.
In addition to being itchy, cockroach bites can become infected quite easily if they are not properly cleaned, so they do pose a risk to the animal.
In addition to the risk of bites, cockroaches also carry bacteria and germs from one location to another. So they can easily contaminate a dog or cats food source if they are also using it as a source of food.
If your home has a cockroach infestation and you also have pets, I recommend that you use a boric acid powder as a pesticide to eliminate the cockroaches. Boric acid is not harmful to dogs and cats, or humans for that matter, but it is highly effective at eliminating roaches.