Can we link a Partner Account and Customer Account through a partner function in salesforce?
A partner user from a partner account (communities) can login as a custom account and create Opportunities on behalf of customer?
If you are trying to link a partner user and a customer user, then you cannot, as users can only be one or the other. But If you have a partner user, that person can create any opportunities that the security rules in the org allow. The part where you may be going off the path is where you want one community user to log in "on behalf of" another one, and that's not possible.