Minecraft wiki entry for teleport, associated text: In Java Edition, when used via the execute command, can teleport between the Overworld, the Nether and the End:
To teleport the executing player to the same coordinates, but in the Nether: execute in minecraft:the_nether run teleport ~ ~ ~
To teleport all players to x=84 y=57 z=79 in the End: execute as @a in minecraft:the_end run teleport 84 57 79
To teleport Alice to x=251 y=64 z=-160 in the Overworld: execute as Alice in minecraft:overworld run teleport 251 64 -160