这个句子加上定冠词可以。即:
Thanks to Beijing's long history as (the) capital of China, almost every hutong has its stories, and some are even associated with historic events.
又如:
It’s unusual to have a goalkeeper as (the) captain of a football team. 让守门员当足球队的队长是很少见的。——摘自《剑桥高级英语词典》