It's a bit abstract but it seems difficult. You will need to reenter country A at some stage, at which point you would usually need to show your visa (or something else entitling you to enter but if you are, e.g., a citizen of country A you wouldn't need a visa in the first place). Some countries also have a police check on exit, where you have to show your passport and might be asked about your status (i.e. why your second passport has no visa and no entry stamp for country A).
On the other hand, if you are a resident in country A, you don't always need to hand in your passport for a long time when renewing your visa. Depending on the country, you might have a residence card or perhaps a “receipt” for your renewal application that would allow you to travel while the application is processed. Short-stay visas also sometimes work that way (you show your passport at the beginning of the application but you keep it while it's processed and you only hand it in at the end to get the actual stamp/sticker).