Which is correct, ei prishlos' brodit' po svetu, kak bezdomnoi sobake, or kak bezdomnaya sobaka
Martin: Very perceptive question! I would argue that "in full," the English sentence would be understood as something like:

It was necessary for her to wander the world, as a homeless dog wanders.

Contrast this with:

It was necessary for her to wander the world, as it would be necessary for a homeless dog to do.

Because she is "like a homeless dog" with respect to the wandering itself, and not with respect to the necessity of wandering, бездомная собака is in the nominative, as the subject of the logically-understood verb бродит, rather than in the dative as the object of пришлось.