As a few have suggested, definitely consider the Nexus 4. Both Samsung and HTC (and truth be told, pretty much every other manufacturer) has an abysmal track record when it comes to updates. At best, you can expect one update, and it'll come months to a year or more after it's actual release - meaning it'll be outdated before you even get it.
Also, I've owned HTC's and Samsungs, and the overlays they put over Android are horrible. Years ago, Android needed the UI refinement they offered, but that's just not the case anymore. Now, they mostly just bogg down the OS.
And finally, the Samsungs I've owned and used have had horrible build quality. Removing the back on my Galaxy S would literally flex the entire phone. My HTC (Incredible 2) has held up extremely well over the years, and while the Nexus 4 is inherently more fragile because of it's glass back and edge-to-edge glass front, the build quality is also very high.
If you're coming from an iPhone, the Nexus 4 will give you a much better feel for Android than the others - better build quality, better performance, timely updates and at $250, far better value.