Quark wasn't a Federation citizen, he was a Ferengi, which are infamous for their market economy (indeed, some of the interactions between Jake and Nog contrasted the two, with Jake having no money, and Nog lambasting him for it). We don't actually know if Baron Grimes is human, but given he sold to both the Federation and the Klingons, he's almost certainly operating outside of official Federation sanction. Maybe like some rich people today he canceled his Federation citizenship to claim residency somewhere more advantageous? Mudd seems to be in a similar circumstance - he operates on the fringes, and frequently breaks the law, thus it's very likely that any fortune he has is stored away outside of the Federation.
Note that on DS9 they were very explicit about this. The Orion Syndicate, for example, operated out of many independent worlds, including Farius Prime and New Sydney. These worlds were canonically not part of the Federation, even though we saw Federation "races" like Humans and Trill living there. They also explicitly had market economies, currencies, and businesses - unlike anything we are aware of in the "Federation proper."