Can you buy apps from apps store on your iPhone 3g when unlocked and on tmobile?

I would believe so, it can be difficult to unlock your iphone though but the iphone is exclusively at tmobile in Europe.