Yes, you can learn freestyle online if you have a pool where you can practice. You will need to send video of your swimming each week to the instructor. You’ll need to practice for at least two one-hour periods between class sessions. One two-hour session works, as well. If you can swim more, all the better!
The online course covers every point and drill of the in-person course. It’s a very good way to learn.