I searched but couldn't find an answer. There is something written in the wiki about being at war status but I want to go sure.
Is it ok to enroll at an Agony class, while being engaged in Faction Warfare?
Yes, its fine;
1) If you have standings, FW, war-decs, etc that will likely get you killed during the first part of the class then it is suggested/reccommended that you use an alt for the first part in hi-sec (or you can come in your pod, but its not nearly as good as actually flying your ship). This is primarily for people who have standings issues with concord or the empire faction near where the class will be held but if there are war targets active near the class area it applies just as much. It's less than a couple days to train a T1 fit rifter.
2) The roam should be in 0.0 with brief travel throw low-sec, so faction war & war decs isn't usually a problem for the fleet. If necessary try to stage in the low sec system next to the hi-sec point of departure. It does make it harder to get your ships & clone ready for the roam. Usually other students or local markets suffice, but plan ahead and get your extra ships to a station nearby and accessible (preferably with a medical facility in case you get podded back to the station).
EDIT: 3) and as aluchem says, you can NOT shoot other fleet members even if they are a war target. On that topic when in fleet you should not shoot ANYTHING that the FC doesn't tell you to shoot. If you have to run/go through a gate/warp off to avoid a fight that's fine. Again, if you feel it will interfere then attend using an alt.