Cmdr. Thomas E. Dyer, 45, the ordnance officer at the Naval Weapons Station at Yorktown, Va., and a former Washington resident, died of cancer Wednesday at his home in Yorktown.

Cmdr. Dyer was born into a Navy family at Oxnard, Calif. He lived there and in Honolulu until he was 9 and his family moved to Washington. He graduated from Woodrow Wilson High School here and from the U.S. Naval Academy at Annapolis in 1957.

He earned a master's degree in physics at the Naval Postgraduate School at Monterey, Calif., and attended the nuclear power schools at Mare Island, Calif., and Idaho Falls, Idaho. His assignments at sea included duty aboard the nuclear-powerd cruiser Long Beach and command of the destroyer William R. Rush. He was a veteran of the war in Vietnam.

More recently, Cmdr. Dyer had served at the Naval Surface Weapons Center in Dahlgren, Va., and at Norfolk.

His marriage to the former Jane Low ended in divorce.

Survivors include his wife, the former Virginia Syer Seaton, of Yorktown; three children by his first marriage, Thomas M., Katherine J. and Charles O., all of Newport, R.I.; two step-children, Pretlow and William Seaton; his parents, retired Navy Capt. and Mrs. Thomas H. Dyer of Sykeville, Md., and one sister, Ann L. Dyer of Washington.

The family suggests that expessions of sympathy be in the form of contributions to the American Cancer Society.