Thank you for your question! This is a complex issue in Spanish.
Ultimately, the answer is that the meaning for these particular verbs in the preterite cannot be the same as it is in the imperfect, no matter what the context is. This is because the different meanings are conveyed by the actual verb tenses. This will sound confusing, so let's break it down.
The imperfect tense is used to describe actions in the past that don't have a set beginning or end - they are simply ongoing. This is why past actions like wanting or having are usually described in the imperfect: they don't have a set start and finish, they are usually just ongoing.
The preterite tense, on the other hand, is used to describe actions in the past that DO have a set beginning and end. An action in the preterite tense is not ongoing - it has been completed.
Knowing that, let's take a look at poder. It's meaning is "to be able to." If we use it in the imperfect tense, that shows that the action was ongoing in the past; it was not completed. The impression given by this is that we "were able to" do something - specifically, we had the ability to do it. It doesn't show that we actually did whatever it was, though. So, if someone says Podía nadar, it essentially means "(I) had the ability to swim"; we don't know whether or not the speaker actually swam. It was an ongoing (not completed) action in the past.
Now, actions in the preterite tense DO have a set beginning and end. So if we use poder in the preterite tense, the impression is that "we were able to" do something - specifically, we managed to do it. In the preterite tense, the action is complete, so it definitely took place. So if someone says Pude nadar, it means "(I) was able to swim," as in "(I) managed to swim" - the action was completed, and the swimming actually took place.
The logic may not seem to line up perfectly, but let's look at querer before we talk more about that.
The meaning of querer is "to want." Again, if we use it in the imperfect tense, that shows that the action was ongoing and was not completed. The impression given by this is that we "wanted" something - specifically, we had an ongoing desire. There was no set start or end to this wanting; it was just ongoing. So we could say Quería aprender español "I wanted to learn Spanish." The wanting was ongoing in the past; it doesn't imply that we actually learned Spanish, it just shows that we had the desire to do so.
Now, if we use querer in the preterite tense, it shows that the action had a set start and a set finish. It was completed. And that actually morphs the meaning of the verb from "to want" to "to try." This shift in meaning can be a bit hard to explain; essentially, that "wanting" conveyed by querer had a set start and a set finish, and so became more concrete. So if we say Quise aprender español, the meaning conveyed is "(I) tried to learn Spanish" - the action of wanting started and then it stopped, so the speaker wanted to learn Spanish and then stopped wanting to learn Spanish. This gives the impression that they made an attempt to learn.
When you compare verbs like poder and querer in the preterite and in the imperfect tenses, it can take a bit of thinking and working out to discover how what is meant changes because of the verb tense; sometimes, like with querer, the logical reasoning behind the shift in meaning can be a bit hard to pin down. This is one of the reasons why it's useful to memorize these verbs as simply meaning different things in each tense. It can also be helpful to keep in mind that the imperfect tense allows these verbs to keep the usual meaning that they would have in the present tense; it's the preterite tense that warps their meaning a bit.
I hope that this was helpful! It is definitely a tricky topic. Let me know if you have any more questions!