Police have warned dog walkers about the dangers of livestock worrying.