It will be extremely difficult to get enough of the classes you need to get a Bachelor's degree on a carrier, particularly until you are fully qualified. As for the classes offered onboard, think mostly Composition and Algebra, perhaps a History course now and then. I have never known many nukes to use the courses offered aboard ship. Watch/Drill/Maintenance Schedules can be exhausting, and you will want to use your "personal" time to catch up on sleep, laundry, or poker.
However, I think that being on a submarine would make things even more difficult. Underway schedules are strenuous, and in-port working hours can stretch to 17-1800 (witnessed at PHNSY).
If you STAR reenlist and get the add-on shore duty, it is possible, no, easy to finish before your 8 years is up.
So can you do it? An AA, maybe, but it will be challenging no matter which you choose.
MMC(SW/AW)