You can't blame the dog on this one. This is called Dog Vomit Slime Mold (Fuligo septica). In spite of it's yuckiness, this is a friend in your garden.
It often appears in wet conditions on woody mulch, in compost bins, on plant debris and sometimes even on living plants. It is a very bright yellow colour and slimy in texture when it is fresh, like, you know, dog vomit. It dries to a burnt orange colour.
Like it's distant fungi relatives, it recycles dead materials making the nutrients available to plants. Slime mold is harmless to soil and plants, pets, and humans, although the dry spores can irritate people with allergies, asthma, or other respiratory conditions.
It usually disappears in a few days but if you don't like the sight of it, you can remove it. Otherwise, leave in place to do its job.