Overall, there are generally not huge problems using another mac to install the OS on to a target mode drive (same as installing to an external drive). The install will work fine and an OS will be present on the drive, but the areas where this will fail are:
- Using a restore DVD on a mac that is a different model (retail OS discs have all drivers for macs requiring a lower build number than the retail disk - restore media have a very specific model's drivers only)
- If the build level is incorrect, the mac may or may not boot properly - and some drivers needed for the mac that eventually runs the OS might not get installed.
- If the installer selects the wrong drivers due to the machine running the install being different than the mac that eventually runs the OS - you may have some problems.
Basically, when a new hardware model is released (new thunderbolt, new logic board design, new battery technology in a portable) - that change is introduced into a separate OS build. I have never seen a public listing of these specifics broken down by model number, but over time these special builds generally get merged into the "main" OS.
Since retail OS DVD change versions maybe once or twice a year, there is a window of time where installing the OS from a machine of type A and running that OS on a machine of type B will have issues due to needed drivers being missing from the retail OS DVD. This chance is much larger if you are using the newest macs and installing across product lines (MacPro to Air / iMac to MacBook).
In practice, the core OS usually works and you can boot the mac and most of the hardware will work. Also, usually you can download the latest combo update and hope that it pushes updated drivers when it is run, but there is no guarantee that installing the OS on one mac will work for all other macs across the board.
People that run large installations and clone one image on to dozens or hundreds of different macs can attest to the ways this breaks certain hardware from time to time. Recently, iMacs wouldn't show a wifi card or produce sound when running an OS installed from anything but those new iMacs.
For older hardware - doing the install and running the OS - the chance of total success is very high. Stack the odds in your favor by ensuring the retail DVD you use has a build number higher than the minimum build for the model you have.
For 100% success, just make sure the mac doing the install is the same as the mac running the OS and use the DVD that came with the mac.