In general, scolding a dog is not at all recommended as they will probably misinterpret your meaning.
However, dogs can understand humans.
You don't have to say "sorry", but the words that you usually use to reward your dog when they behave correctly, such as "well done" or "good boy".