NO! Do not use soap to clean inside a canine sheath, you can do more harm than good in most cases. If the penis is dirty, warm (body temperature) water can be used to rinse it off.
Most dogs will keep their penis clean anyway through their natural licking. The opening of the sheath generally closes when the penis retreats inside, this has two functions, it helps keep the penis clean when the dog is doing stuff like playing in the mud, or rolling in that... well whatever that was that smelt great to your dog, so much so they need to put the scent all over themselves. The other function of the sheath opening is to wipe excess materials off the penis as it is being pulled back inside after an erection.
excess smegma can be wiped off the end of the sheath with your fingers or a soft tissue, if you are doing oral and don't like the taste. a certain amount of smegma is normal and healthy for a dog to have though.