Assuming you mean “can I buy an Instagram handle from someone,” then sure. You reach out to them, offer them something they are willing to trade the handle for, you give them whatever it is they wanted in exchange (e.g., money), and they give you the login credentials (which you then immediately change).
But to answer your second question: no, Instagram is not okay with this. It’s pretty clearly a violation of their Terms of Service. Under the section title “Your Commitments,” it says: “You can’t attempt to buy, sell, or transfer any aspect of your account (including your username) or solicit, collect, or use login credentials or badges of other users.”
So while it’s definitely a thing that happens, you risk losing the account if Instagram catches on to what has happened.