Where? Training works best, just have to be diligent until you break them.
Inside? What do you have? Were they housebroken? How often do you take them out?
If you are talking about your dogs getting into your flower pots like mine do, I've had luck putting rocks around my plants. I've also used a hot sauce spray on the flowers which they do not like... it keeps the squirrels out too!