There is no one definitive answer to this question as it depends on the account in question. However, in general, if an account can be accessed via a Google or Apple ID, then it is likely that the account information is stored in association with that ID. This means that if you were to delete the ID, the account would likely be lost as well.