The MacBook you can run as a dual screen computer, i.e. if you hook up a monitor then you can gain extra desktop space.
The iMac you can only screen mirror I believe, i.e. if you hook a monitor it will display what you see on the iMac screen.
Now I am not sure about your question, are you asking if you can use the iMac as a second screen for the MacBook?
Short answer, no.