Democratic primary is a wide-open race, and the mayor’s ties to Donald Trump may make him more vulnerable in the election.