There is a map guide which usually dictates which teams play in which regions. The FA and the league makes the decisions on league allocations for edge cases.
To answer the second question, yes teams can be moved in between seasons to facilitate a realignment of the divisions. There have been instances of teams as south as Gloucester being placed in the National League North from the National League South due to more southern teams being relegated from the National League.
There is a period after the allocations are announced where clubs can appeal and make a case to be moved to another division, in which they usually argue that they cannot afford the increased travel costs.