It depends what source you go with but afaik, an operational deployment method has never been confirmed (or seen) in canon.
A walker's body section can carry 40 fully-armed and battle-ready
stormtroopers. To load and disembark troops, the AT-AT kneels by
bending its tri-jointed legs and lowering its body to within three
meters of the ground. A landing ramp drops from the rear of the
vehicle to deploy passengers, in addition, hatches on the flanks are
used when docked at Imperial boarding platforms.
Star Wars: RPG Sourcebook
and
In order to release troops, an AT-AT kneels to within three meters off the ground and lowers a rear assault ramp.
The New Essential Guide to Vehicles and Vessels
and
AT-AT walkers load and drop the troops they carry by "kneeling" to allow the use of a ramp in the main body. In this way, battle-ready Stormtroopers "hit the ground running," weapons drawn, initially shielded from enemy fire by the massive bulk of the walker above and around them. Side-mounted hatches allow personnel to enter or exit the vehicle via the boarding ramps of Imperial landing platforms.
Star Wars: Technical Journal
and
To deploy its complement of troops, an AT-AT must kneel. With the body
still three metres from the ground, ramps are lowered for the 40
troops and four speeder bikes to disembark. It is also possible for
the troopers to rappel down drop lines from the AT-AT, though they are
very vulnerable doing so.
Star Wars: The Official Starships & Vehicles Collection 4
and
ASSAULT CARRIERS
AT-AT walkers can unleash their assault forces in several rapid waves using drop-lines with attached harnesses. Boom racks extend to drop combat troops and equipment over the side. Speeder bikes are deployed using harnesses at front and back.
Star Wars: Incredible Cross-Sections
As to how they load (and unload) the AT-AT when they have access to a military base, this is accomplished using a loading platform.