Answering this because I do have experience trying to create exactly this kind of creature.
To sum up my view of this sort of problem after researching this, as well as winged humanoids...
It's going to be a tradeoff between the two things you want your creature to be. The creature will, ideally, be more comfortable in one form than the other, otherwise it's going to do neither thing well. The more capacity you give the creature in one form, the more it's anatomy will inhibit it in the other. For instance, I settled for making my winged humanoids clumsy fliers with less arm strength than they would otherwise have. They also need to warm up their wings to extend the feathers, which is something that allows the feathers to retract a bit when not in use and lets them do normal things like sit in a chair... But they're hindered in that they can't take off quickly in an emergency.
Don't ever get discouraged by this. I was very discouraged at first when I realized how impractical some of my initial creature designs were. But sometimes that tradeoff can give you fun challenges, and especially in fiction, there's enough room to squeeze down or mitigate the drawbacks so that you can get something very close to what you wanted, but still be believable. Maybe even more so because the creature now has some well thought out weaknesses.
"Near-identical" might be a tall order, or it might be doable, depending on the extent of use you want them to make of each form.
Bipedal digitigrades are a sliding scale. If your priority is on the "dog" form, you could have them look very doglike indeed with maybe some more developed muscles in the hind leg calf. They could stand for short periods, or squat comfortably with hands off the ground. That would enable conversation with humans and standing up for cool poses or to see further away.
Since this is sci Fi, perhaps they have some prosthetics or special shoes that assist them in standing without discomfort, but can be removed for more animalistic, four-legged tasks?
The more time you want them to be standing on two legs and walking, the more adaptation you are going to have to do. My own species has "thumb toes" on their feet which fold in for walking and fold out or grip to give better balance when standing still. The length of the "foot" should be decreased relative to the rest of the leg, bringing it closer to a human with elongated feet standing on tiptoes, if you want them to have a more stable biped stance. This makes walking on all fours less graceful, but has the advantage of making them very fast runners in biped form. Heavily biped digitigrades will need some alterations to their joints to accommodate the greater strain. Think thicker, sturdier legs that look like a hybrid between a human's and animal's. My species stands on a "heel" (actually the ball of the foot) thickly padded with cartilage.
Somebody else made an interesting point about the neck. You could take the opportunity to develop some physical adaptations regarding that, but again, if you're writing fiction you have a choice about how in depth you want to go.
Another thing you should consider is the arms/forelimbs. Dogs and cats have their elbows very close to their shoulders and a very long foreleg. This is the best arrangement for walking or running on all-fours. Humans have our elbows placed much further down, making the limb more flexible, but sacrificing it's ability to bear weight. Have you ever walked on all fours yourself? You'll notice that your legs are disproportionately long and that your elbows make it awkward to bear weight. But the "dog" elbows are useless for any kind of tool usage, and even kind of awkward for gesturing in conversation.
I don't know much about your world, either. Is there magic, or "sufficiently advanced technology" that would allow morphing or physical adjustments as they change stance? Biological nanobots? That could solve many problems, but I understand not everybody wants to go that route.
The role these animal people play in your world, society or any of the stories in it should influence which compromises you're willing to make, and which part of the sliding scale you want to put them on. Is it very important to you that they look like actual dogs? Then you may want to skew them towards being dogs that can stand up briefly for conversation but can't sustain that posture. For my species, the importance of making them human-like in tool making ability heavily influenced the outcome. I chose completely human elbow position and worked details into their culture to account for the fact that they aren't comfortable standing in one place for very long. They can't really run on four feet, but they can squat and crawl, and walk on four legs to get under a low spot easier than we can. It's always going to be a compromise. But again, think about the role you want them to play, and weigh the benefits of different degrees of adaptation.