Definitely check with your local shop (or the shop at the hotel/ resort you'll be going to if you plan to get certified on vacation). Some shops won't accept online classes, others only work with certain certification agencies.
If you'd like to go with PADI, their online instruction program lets you search for dive shops around the world who should accept their online information although you still will want to call for pricing and to schedule your pool and open-water dives. You can learn more at
https://www.padi.com/padi/elearning/
Hope this helps...