Algebraicity criteria, invariant subvarities and transcendence problems from arithmetic dynamics