Born at the "Bonneville" plantation in Dinwiddie County in the Colony of Virginia, Pegram received a private education suitable to his class.
As a young adult, Pegram held various local offices and won his first election in 1797, becoming one of Dinwiddie County's (part-time) representatives in the Virginia House of Delegates.
[1] In 1802, Col. Pegram replaced revolutionary war veteran John Crawford as commander of Virginia's 39th Militia regiment, composed of white male volunteers from Petersburg who were required to attend yearly (and sometimes monthly or even more often); beginning in 1808 his counterpart in the 83rd Regiment (composed of white men from Dinwiddie County) was Lt.Col.
[2] Pegram became the major general of the Virginia militia in the War of 1812 and held field command of all state forces.
Pegram won a special election as a Democratic-Republican to the Fifteenth Congress to fill the vacancy caused by the death of United States Representative Peterson Goodwyn.