The attorney general’s office is investigating recorded calls that appear to use a voice crafted to sound like the president to tell voters not to cast ballots in the presidential primary on Tuesday.