In a support document, Apple notes that you can charge the battery pack through the iPhone 12 if its plugged into a power supply.
If both your iPhone and MagSafe Battery Pack need to be charged, you can charge them at the same time. Attach your MagSafe Battery Pack to your iPhone and then plug the MagSafe Battery Pack into a power adapter. Using a 20W or higher power adapter, the MagSafe Battery Pack can charge your iPhone with up to 15W of charging power.
You can also charge both if you attach your MagSafe Battery Pack to your iPhone, then plug your iPhone into a power source. You might want to charge this way if you need to connect your iPhone to another device while charging, like if you're using wired CarPlay or transferring photos to a Mac.
Apple notes that if you charge your iPhone and MagSafe Battery Pack at the same time, your iPhone might charge to 80% or higher before your MagSafe Battery Pack begins charging.
You can purchase the MagSafe Battery Pack at the link below for $99.