Neither, really. Both the prefectures and the people are named after important locations in the prefectures. A good deal of Japanese people have toponyms or toponym-esque words for family names (though this is of course not unusual, consider how many people of English descent are named 'Somethingfield'). Both the creation of prefectures and the universality of family names were things that came about in the last half of the 19th century, while many of the places referenced in those names have had their names for centuries; so both prefectural and familial names come from preexisting toponyms.