These are 2 different concepts:
Packages in the AppExchange are managed, which means that the metadata (code, etc.) is protected and you cannot view or edit the components (you can view the markup in VisualForce pages).
AFAIK, you cannot install a package in your org using migration tool, but I might be mistaken.
You cannot download the code from a package from the AppExchange either, for the reasons stated above.
With the migration tool, you can upload/download unmanaged metadata between your hard disk and the SF org. We use it all the time to keep all the metadata in source control.
In short: if you install a package from the AppExchange, all the metadata will be in your org, but locked. If you upload metadata (hopefully that you created) with the migration tool, your metadata will be available to be edited in the org.
Having said all that, you can upload metadata using the migration tool, and then create your own managed package from your org.