In some cases, yes you can. Just be sure to consult your professors about your plans to pursue certifications while studying online. Taking this step will help ensure you have the right experience and preparation to qualify and pass.
Some BSPH programs even offer courses that will get you ready for specific certifications as part of the learning experience. At UTA, the course KINE 3357 - Physical Activity and Public Health prepares students to sit for the Physical Activity in Public Health Specialist (PAPHS) certification exam offered by the American College of Sports Medicine.