Dogs and cats have different nutritional requirements. Cats are true carnivores, so they require more protein than what is generally found in dog food. It is okay if cats eat dog food occasionally, but they may become malnourished if dog food is their main source of nutrition.
It is normally safe for dogs to consume cat foods, but it is not recommended for optimum nutrition.