Agile practices can work in just about any organizational structure. The more you do agile, the more you'll identify areas in which you could optimize your organization to be more effective.
Let's first talk about functional organizations vs. cross functional organizations. In a functional organization, you have one group do product management, another do development, another for QA, etc. This made sense in waterfall because you handed off from one functional area to another.