OK I'm unsure of your level of Sonar knowledge and experience here, so I've two suggestions.
1. If you are asking how to record MIDI and play it back via a soft synth (such as Dimension Pro), I could take you through it step by step, but Tutorial 4 in the manual/help "playing and recording software instruments" probably explains things more clearly and completely than I can. Have a look a that as your next move.
2. If, on the other hand, you have inserted Dimension Pro into a project, loaded a patch, have the necessary MIDI and audio or combined "instrument" track set up, and it's receiving MIDI input from your controller and operating the synth OK but refusing to record when armed, that's a different matter. If this is the problem, it might help to know how you have MIDI routing set up on the relevant track, MIDI channel, etc.