Yes, you can install and activate your eSIM before you travel.
Your validity period only starts once your phone connects to an Indonesian mobile network — not when you scan the QR code.
This means you can set everything up in advance and go online immediately upon arrival.