NFL and college/high school are different.
In the NFL, all touchdowns from scrimmage count as a first down.
In high school and college, it is just a little bit different. If a touchdown is scored on a goal to go play, no first down.
If the play from scrimmage has a line to gain for first down before the touchdown is scored, then there is a first down.
NFL rule book, NCAA scoring plays casebook. High school and college football statistician since 1976.