The proper workflow for most tracking is to track the original shot then use the tracking information to control something else. In the case of 3D camera tracking you apply the data to a camera and position a reference layer in the scene.
In some cases, where there is a lack of detail or the tracked object can be better defined by the addition of things like Color Correction effects you would apply the effect, pre-compose or pre-render to a lossless DI and then track the modified shot. Generally you would not use this modified shot in your production, you just want the tracking data.
On rare occasions there are compression artifacts or Intra Frame compression problems with the original footage that you will only get a successful track if you render the original to a lossless DI before tracking. You also need to render a DI if your original codec is not compatible with the tracker. Mocha is very sensitive to highly comprised formats and the Warp Stabilizer (a form of tracking) and AE's other trackers may also not like highly compressed originals either.
There is also one un breakable eternal law that no one has yet found a way to circumvent. Some shots will not track with one tracker but may track with another. IOW, you may not be able to do a 3D camera Track with the Foundry's Camera Tracker, or AE's Camera Tracker but you may be able to get a successful track with Syntheyes or MOCHA Pro, or other tracker software, but some shots cannot be tracked with any software. For example, an aerial shot of the ocean from an airplane cannot be 3D camera tracked because there is no fixed geometry in the shot. A shot of a wheat field with the wheat blowing in the wind many not be able to be tracked because there is no fixed geometry in the shot, but it may be able to be stabilized if the horizon is well defined.
If you apply any distortion effects or do masking or anything else the the shot will only track if you pre-compose but the effects may throw off the final result. If you must apply effects do them after you track the shot unless paragraph 2 applies. If your track fails and you are confident that there is enough fixed geometry in the shot to track then see paragraph 3.
Thank you very much