Yes, you can do it on the ground if you have good comms or airborne on departure. Specific procedures may vary - eg you may get a code when you call Centre while still on the ground and be directed to call Appr airborne for the clearance. If in doubt call Centre and ask them! Generally facilitated if you have a plan in the system - expect a short delay while they put some details in the system for you. If you have a plan in the system and ADSB, they will probably be anticipating your call!
Dr