While programming offline you are not physically driving the machine, you are simulating everything. This is generally done from a CAD model, but can be done without one.
While you generally program with the software you will actually use on the CMM itself, there are several packages available that will allow you to create a program and export it to native DMIS code. I believe Unigraphics offers this module, but I could be mistaken. Otherwise, depending on the software company's licensing requirements, you may need a separate license to program completely offline, or you may be able to program offline while the computer is actively connected to the CMM controller (PC-DMIS uses this method). There are some packages that actually read plain text, so you could program in Wordpad (or similar) and copy and paste it in, though this requires intimate familiarity with the software. The downside to using a different package than the one you will be using on the CMM is not having all of the functionality available. However, if you can program the bulk of the features and the moves before bringing it online, it can save you some time.
If you're going to export native DMIS code, you need to be sure the CMM software will to be able to read it. This is usually met with different levels of success, but it's safe to say you will still need to spend some time tweaking the program. If you've programmed in the same language you should have far fewer problems. Regardless, you will need to spend some time proving out the program.
Programming online uses many of the same techniques, plus it gives you the benefit of being able to physically touch off the part. If you aren't real familiar with the software and don't have CAD available, this is the only method you could use. A big advantage to programming online is the ability to see the reality of clearance issues you may run into while programming.