Thermally and Dynamically Driven Magnetic Flux Penetration in Type-II Superconductors