My sheep have recently been twice attacked by a dog and several injured. What is the legal position regarding shooting a dog under these circumstances?

First, though the owner of a dog worrying sheep is committing a criminal offence, the law creating this offence does not empower the farmer to shoot the dog. These days a farmer who shoots someone’s marauding dog is quite likely to be charged with criminal damage. If he is, then his defence will be likely to show he has reasonable excuse as he was protecting his sheep, which are his property. The farmer would have a similar defence to a civil action taken against him for shooting an offending dog.

He would also need to have notified the police within 48 hours of the shooting.
As to using a rifle to shoot a dog, it must be appreciated that a dog is not vermin, as vermin is, by definition, wild. Therefore, a rifle conditioned only for the shooting of vermin or pests would not be conditioned to shoot a dog, unless the certificate had printed on it (as some do) an additional condition authorising the holder to use the rifle for the shooting of animals for the protection of other animals