Can I install OS X from external hard drive to internal hard drive?
Yes - Mac do not care if the boot drive is connected internally or externally.

I usually recommend installing the OS on the new drive with it connected externally since you don't do the swap until after you know the drive boots externally, but the opposite order is fine.

Now, if you have problems, it's going to be because of hardware issue (cable, or drive failure) or possibly the software isn't complete / correct.