The rules mesh just fine going from Modern to D&D. You can play a Fast Hero/Smart Hero/Field Scientist or a Dedicated Hero/Contemplative Master/Sensei or even a Strong Hero/Barbarian/Wizard/Martial Arts Master in a D&D campaign and they will work just fine. The Modern classes have a class defense bonus (giving them better AC, especially at higher levels) and better skills, but fewer hit points than non-casters in D&D, along with generally weaker saves and BAB. Give them magic items and they are about on the same level as D&D characters, albeit they have different strengths.
Going from D&D to Modern, you can import fighter-types without much issue, provided they don't bring their magic gear with them.
Spellcasters are, as usual, the big problem. In Modern, they are capped at 10th level (effectively) and have to wait a few levels to get into a spellcasting class. A lone 15th level D&D spellcaster can, with creative use of his spells, literally conquer the entire Modern world, and can kill any living thing on it without even bothering with creative use of his spells.
Basically a 'fish out of water' adventure of fantasy characters in Modern can work either smoothly or lumpily, depending on how high a level your PCs are.
At 1st-2nd level, Modern characters will be more powerful thanks to modern weapons.
At 3rd-7th level, D&D and Modern characters are pretty much on par.
At 8th-10th level, D&D characters have the edge thanks to magic items, provided they are going by the wealth by level guidelines.
At 11th level or higher, D&D characters are inevitably going to be more powerful because they can get 6th level spells and above.
Now, dimension-hopping Nazi aliens can be as powerful or as weak as you want to make their tech. If they're packing PL 8 heat (PL = "Progress Level," a term introduced in d20 Future - Modern is PL 4, IIRC), they can waste a planet's worth of all but the highest level characters without much trouble, and their tech is so advanced as to be indistinguishable from, or at least able to stand up to, even high level D&D magic.
I would say that, considering the way the rules interact, the latter scenario (Modern-rules characters invading a D&D-rules world) works much, much better than the former (D&D PCs in a Modern world).