More people walked here than drove.
More people walked here than they drove.
Are both sentences all right? Thank you in advance.
The 'they' in your second sentence appears to take 'people' as its referent, and that would refer to the people who walked there, which is wrong.
"More people walked here than they could accommodate". In this sentence, the referent of 'they' is outside the sentence - it's a general 'they' meaning the authorities, or the people responsibile for accommodation. It works in this sentence.