Dark energy versus modified gravity: Impacts on measuring neutrino mass