A county may regulate the conditions under which dogs and livestock may be at large or pass over public ways.