As I understand it, the iPhone 3G has what's called "assisted" GPS, which should probably be renamed "reliant" GPS. You can read some Wikipedia articles about AGPS for more info, but the gist is that a completely stand-alone GPS receiver usually takes several minutes to get its first location fix because it needs to download fresh info from the satellites which by-design happens on their slowest data link.
To save you having to sit there in Maps for several minutes, the phone relies on extra help from the cell-towers nearby. It sends fragments of the messages it's getting to the cell towers, which themselves have GPS receivers, and the towers send back the completed data. That saves the iPhone from having to download all the satellite info itself.
To the best of my knowledge, this requires an active cell data connection, so if you're roaming and data roaming is turned off, you won't get the "assistance" from the cell-towers. Also, as I understand it, and from personal experience, the iPhone is reliant on this assistance and won't fall back to downloading all the necessary data from the satellites over the 5-10 minutes it would take.
If you're connected to a WiFi hotspot through which you can actually browse the web (i.e. not just redirected to a login page), then you ought to still get a rough location fix via the Skyhook service. No hope for GPS though, as it requires the cell-towers specifically, not just any internet access.