William H. Dallam was born on August 16, 1825, in Darlington, Maryland, to Richard Dallam and Sarah Wallis. His father worked as a farmer and apparently owned no slaves. His mother died around 1828. Dallam was admitted to the bar in 1849 and began work as a lawyer soon afterward. He joined the Democratic Party, and in 1851, he was elected State's Attorney.
He married Mary Cordelia Maulsby in Bel Air, Maryland, on January 22, 1852, and they had at least four children: Jane, born around 1852; Sara, born around 1854; Mary, born around 1858; and Richard, born around 1865. Dallam joined the Know Nothing Party around 1855 and secured two more terms as State's Attorney. By 1860, Dallam owned $2,000 of real estate and $500 of personal property.
"At the breaking out of the war," one local writer later observed, Dallam "took the Union side." On September 5, 1862, he mustered into the Union army as a major in the 7th Maryland (Union) Infantry. The regiment spent the winter of 1862-1863 on guard duty in the defenses around Washington, D.C., and took part in the Battle of Gettysburg in July 1863.
Dallam resigned from the regiment on November 12, 1863, explaining that his “health which for many years has been delicate has become so much impaired by the fatigue and exposure of the service as to render me no longer fit for military duty.” He added that the "Unconditional Union voters of Harford County" had elected him Clerk of the Circuit Court, and these "loyal people...particularly desire my immediate acceptance of the position." Charles Phelps, the regiment's lieutenant colonel, supported Dallam's decision, writing that he "will be of more service to the Union cause at the bar of Harford County...than he could possibly be at his post." Army officials accepted his resignation two days later.
Dallam helped organize a Conservative Republican Party in Harford County in 1866, and the party elected him County Clerk later that year. By 1867, however, he had re-joined the Democratic Party. He eventually became Auditor of the court, and in 1882, he was appointed Deputy Collector for the port of Baltimore. According to one writer, he "filled the various offices he held with credit and ability." He also continued his work as a lawyer, and by 1870, he owned $10,000 of real estate and $1,500 of personal property. He contracted a cold during the winter of 1881-82, and according to one reporter, “his lungs were seriously affected.” He eventually recovered and resumed his duties, but he fell ill again during the summer of 1882. He died near Bel Air on February 22, 1883.