Is it legal within the NFL and NCAA rules that the main passer is assigned a halfback or fullback number on the team while the running back is assigned to the quarterback one? For example, could Tom Brady, a quarterback, be assigned the number 20, which is reserved for running backs (and defensive backs)?
The NFL rulebook states in Rule 5, Section 1, Article 2:
All players must wear numerals on their jerseys in accordance with Rule 5, Section 4, Article 3, Item 3. Such numerals must be by playing position
followed by a list of positions and allowed numbers. (Rule 5, Section 4, Article 3, Item 2 specifies the size etc of numbers on jerseys). Therefore any player who is not wearing an appropriate number is in violation of the rules - however, the rules give no indication of what should happen if a player is wearing the wrong number, but my suspicion is that the NFL would simply not allow the player to be registered with that number.
There is a proviso in the same article that a player who changes position during their career is allowed to keep the same number, so long as they played at least one season in their original position and are not moving from an "eligible receiver" position to an "ineligible receiver" position or vice versa.