> Is it possible to download an app from the App Store onto an iPhone and then delete the Apple ID and be able to still use and update that app after putting in a different Apple ID?
Actually yes, but it's not relevant.
Ostensibly, each app that's downloaded and installed via the App Store is 'locked' to the Apple Account that was used to install it. This account needs to be available/logged in for any future app updates.
It is possible to migrate apps from one account to another, but it then renders it unusable/unregistered for the original account, which is why it's not an option here.
At the end of the day, though, it's irrelevant. The recipient of the phone can (and should) just install their own copy of the TikTok (or any) app on the phone when they get it. Even better, they shouldn't ever buy a used phone and use it as-is. I'd always wipe it and start fresh because you don't know what other cruft the seller has left behind.