DALLAS—Recent polls show a surprisingly tight race in Texas between Donald Trump and Hillary Clinton, and a surge in registered voters is adding to one of the election’s great unknowns: Could the presidential race end up being unusually close in the reliably red Lone Star State?

A Democratic presidential candidate hasn’t won Texas since Jimmy Carter in 1976. John McCain beat Barack Obama by 12 points in 2008, and Mitt Romney won by 16 points four years later.

A...