In Porto, you really want to be relatively near the city center and the river. We stayed at Inpatio Guest House, it was very excellent. I believe Rick Steves still recommends them. It was well located, quiet, and the hosts very helpful. That was in 2020 though, just before the pandemic, so things may change.
In Lisbon, there just are so many options. I suppose the Baixa is central, I have stayed along the river, and it was great, I have also stayed further up the central area in a Holiday Inn.
In Lisbon, there is a decent Metro, some trams and rail, and to be honest, Uber and Bolt are very reasonable, I rarely use those platforms, but did a half dozen times in a few days. Even a trip from the airport to central Lisbon was less than 15 euro.