Buying apps with different AppleID than one used to buy OS X Lion Case: I bought a new Macbook pro and I got lion as free upgrade. 

By mistake my friend's apple id was stored in the Mac App Store and I didn't notice the error when I entered my redemption code. 

I already redeemed that lion upgrade using my friend's id on my machine. 

The purchase, download and upgrade all happened on my machine. I intend to keep on using that Lion for my machine only. 

I download new apps and everything using my apple id not my friend's apple Id. Will it work?
Or for my new upgrades or downloading new apps, do I need my friend's ID and password.

Moral: Lion has been downloaded with different ID and Now I want to use my apple id to install new apps.
It will work, although it will not be legal.

It will work, because OS X doesn't care what AppleID it was bought with and you can easily buy new apps using any other AppleID. I.e. if you have more than one AppleID you can use any to buy apps and they don't have to match the one you bought Lion with. It will slightly complicate the apps update process, but it will work without any problems.

It will not be legal, because you will be using OS X Lion bought with someone else's AppleID - not yours. So you are not legally allowed to use it.

In your initial question you ask whether you can transfer Lion purchase from one ID to another. No. Apple's policy does not allow transferring purchases between IDs.