If you took the photo, and had permission to do so, the photo belongs to you and you can use it nearly anyway you like. If someone else took the photo, you must ask permission from the photographer to use it and you should post a credit for their work. Photos are always the property of the photographer, not the dog's owner unless that right has been transferred.
Now, I figure you're probably talking about posting candid pics here on NN and most members wouldn't mind. But be careful about posting other photographer's photos of people's dog here or elsewhere. It all has to do with legal copyrights.
The easiest way around all that is to just get permission, in writing, from the photographer first . Many will be pleased to have their work shown if they get the credit for it. Others may want to control how the photo is used. For example, I have agreed to allow certain photos of my dogs to be used exclusively in commercial advertising for dog toys or for published articles. Once I do that, those photos cannot be used commercially elsewhere so I need to maintain control of where those photos are published. Some photographers may also digitally and invisibly watermark their photos which allows their usage to be tracked.
And, as mentioned above, it would be nice to have a heads up if the photo is likely to be embarrassing.