WASHINGTON — Gov. Larry Hogan of Maryland, a moderate Republican who is considering a primary challenge to President Trump, said on Saturday that Mr. Trump’s victory in 2016 was an “anomaly” and urged his party to work on appealing to voters outside its “shrinking base.”

Mr. Hogan said in an interview that he was not actively preparing to run against Mr. Trump and acknowledged that the president remained popular with his fellow Republicans. But in an interview during the National Governors Association conference in Washington, Mr. Hogan said he was open to running and listening to entreaties from Mr. Trump’s Republican critics.

Mr. Hogan, 62, said that while many Republican voters feel a sense of loyalty to a president from their party, he was not convinced that Mr. Trump had a “lock” on the Republican coalition. Citing his own performance in the midterm elections, when he won re-election handily in a racially diverse blue state, Mr. Hogan suggested he was the kind of leader who could broaden the party’s appeal.

“I think there are a lot of Republicans that are concerned about the future and that want us to continue to be a bigger tent and to reach a wider audience and to not alienate people and not to be as divisive,” Mr. Hogan said.