While there were certainly closed phons prior to iPhone, there were also open platforms like Windows Mobile. You could run whatever app you wanted to on Windows Mobile.
The relationship between phone manufacturers, OS providers, and careers was pretty complex that nearly every combination of openness and restrictiveness was part of the market before 2007.
But if it was a smartphone then it allowed third party apps to be installed without restriction. However, the OS itself might have been heavily controlled and/or modified by the carrier. It was common that say, Microsoft, would release an OS update and then that OS update goes to the carrier for testing and modification and then sometime later you get it. Apple, of course, was not interested in participating in that system.
Part of the early success of Android was that being an open platform meant that carriers retained a huge amount of control and they would release heavily customized carrier-specific phones.