“We all know ricochets can go in pretty much any direction.”
Only if the gun is discharged.
Where the ricochet went might have been bad, but that shouldn't preclude the officer protecting himself against an attacking dog.