We know that by 2400 there are Ferengi cadets graduating from Starfleet Academy and by the 32nd Century there’s even a Ferengi Captain, among other Ferengi officers.
While not being a Federation member doesn’t preclude you from serving in Starfleet, there’s that to consider.