First, as of that episode, 8472 had not yet infiltrated Starfleet, as far as we know, but the mere existence of such a facility shows that they were planning to infiltrate Starfleet in the future. So based on that, 8472 wasn't going to choose their disguises based on current demographics. They would choose based on future demographics.
Yes, Nog was the first Ferengi in Starfleet. He was not the last. Nog's father, Rom, worked for Starfleet as well. He worked under Chief O'Brian on DS9. Legally, this could go under Bajoran militia or Starfleet, due to the way DS9 was run, but Rom was working under a Starfleet officer, and I'm assuming that he was working for Starfleet, because he was in the meeting where they came up with the self-replicating-mines, of which everyone else was Starfleet officers. Additionally, Rom worked as a spy for Starfleet on DS9, during the Dominion's occupation of the station. Rom also counts as a Starfleet employee, and therefore, there was more than one Ferengi in Starfleet.
But back to the question;
From their initial period of hostility in the early TNG years, to the dominion war years, relations between the Federation and Ferengi have significantly stabilized. They hadn't even had a formal first contact as of the first episode of TNG, and yet as of DS9's "Profit and Lace", a Ferengi woman went to Vulcan for plastic surgery. In that time, they have gone from openly hostile to plastic surgery tourism. Is it hard to believe that people from a neighboring power would be a major immigrant population?
Additionally, I'm uncertain of how Federation citizenship works, but as of later TNG and early DS9, there were Ferengi living full time in the areas surrounding the Federation, such as in the Bajoran sector. With the federation more or less constantly growing, especially in the complex case of Bajor, it's possible that some Ferengi or part-Ferengi people may be born in the Federation, or to a Federation citizen. So it's fully possible that with the thawing relations and their more and more intertwined demographics, there may be Ferengi who are federation citizens. These citizens would be able to attend Starfleet academy without the special paperwork for non-citizens, so a Ferengi who is a Federation citizen is completely believable.
Furthermore, perhaps 8472 thought that Starfleet was more likely to add non-citizens to their ranks. To quote what's-her-name from the episode, "They'll attack any species that's not part of their federation. They can't be trusted". Perhaps 8472 thought that the Federation was imperialistic, "based on the Federation's growth pattern", and would likely try to annex the Ferengi Alliance by the time they were ready to start infiltration "which would be an easy task, considering that the Ferengi fleet is mostly merchant vessels".
In summary, 8472 probably was choosing their demographics based on what they thought the real demographics would be in the future during real missions, rather than the present, in fitting with their desire to "reproduce [starfleet headquarters] in every detail". Species 8472 probably extrapolated that there would be more Ferengi in Starfleet in the future, and likely planned for it when choosing species.
Now, this may sound far fetched, but I'm going to point out that we never saw a single Andorian in that episode, and the Andorians were dying out at this time. 8472 probably looked at the data that Voyager had about the alpha quadrant's demographics and assumed that an Andorian would be rare enough to stand out by the time they started their missions, and didn't include one. From that perspective, it's completely believable that 8472 was using population statistics in their planning of the infiltration, and believable that the Ferengi would be present.