Per the top answer to this question, there's a tendency in many languages for words to shift in meaning between probability and desirability, where probability covers what englishclub.com define as zero/first/second/third conditional modes (certain/probable/possible/impossible).
The "core" sense of can/could involves capability, which is part of the probability/desirability issue, so along with other modal verbs it has many inconsistencies and idiomatic meanings.
Turning to OP's specific examples...
"They didn't let us. We could walk." is perfectly valid, given an appropriate context. For example, we tried to borrow wheelchairs from the hospital, but because we were capable of walking they wouldn't let us have them.
"They didn't let us. We could have walked." is harder to contextualise sensibly, but it can be done. Maybe we were in a pub where they wouldn't let us smoke indoors, and we were so angry we could have walked [out] (but we didn't, because we wanted a drink more than a smoke).
"I listened and I could hear something." is a fairly straightforward usage, where "I could hear" emphasises I was able to hear more than a simple "I heard" would.
"I listened and I could have heard something." is a more complex usage. In this case, could doesn't have the sense of having been capable of hearing. It's being used to indicate a (relatively low) degree of probability. So low, in fact, that the speaker is expressing uncertainty as to whether he did in fact hear anything or not. But in that particular case, it's at least possible something was heard.
The list of alternative meanings attaching to could, and could have could and probably does fill a book. As Lynn has noted, present/past tense may imply different meanings, but...
It was so loud I could hear it (loud enough that I was able to, and did in fact hear it)
It was so close you could touch it (but you didn't, you probably weren't even there)
It was so close you could have touched it (again, you didn't actually touch it)
I was so upset I could have cried (but by implication I didn't actually cry)
It's important to note that the second and third examples there mean exactly the same thing in most contexts. Only a pedant would worry about mixing the tenses - you didn't touch it anyway, so it really makes no difference when you didn't do what you never did.
TL;DR: Present tense could often means you are capable of doing something - and possibly that you have just done, are doing, or are just about to do it. Past tense could have often means you were capable (but didn't), but it may express uncertainty about whether you actually did (or unwillingness to say whether you did or didn't).