In setting out to demonstrate that only God can forgive sin, the first premise to establish is that all sin is primarily or ultimately against God. The premise in question (the Old Testament Biblical basis to the claim that God alone can forgive sins, and not one who is delegated with authority by God) follows naturally after that.
When David committed adultery with Bathsheba and murdered her husband Uriah (2 Samuel ch. 11-12) , and after David is confronted by Nathan the prophet, David says: "I have sinned against the Lord".
Psalm 51 states that it is written by David and has the Bathsheba incident and God's sending of Nathan the prophet as it's subject matter:
To the choirmaster. A Psalm of David, when Nathan the prophet went to him, after he had gone in to Bathsheba. - Psalm 51:1
What David declares in this Psalm is:
Against you, you only, have I sinned and done what is evil in your sight, so that you may be justified in your words and blameless in your judgment. - Psalm 51:4
This is not to ignore the sins against Bathsheba and Uriah but to indicate that the primary victim of all sin is God.
In the Levitical law a wrong done to another was required to be recompensed to that other, for instance:
If anyone sins and commits a breach of faith against the LORD by deceiving his neighbor in a matter of deposit or security, or through robbery, or if he has oppressed his neighbor or has found something lost and lied about it, swearing falsely—in any of all the things that people do and sin thereby— if he has sinned and has realized his guilt and will restore what he took by robbery or what he got by oppression or the deposit that was committed to him or the lost thing that he found
or anything about which he has sworn falsely, he shall restore it in full and shall add a fifth to it, and give it to him to whom it belongs on the day he realizes his guilt. - Leviticus 6:2-5
But notice that this deception against the neighbor is classified primarily as a breach of faith against the Lord. He must make reparation (with interest) to his neighbor and then he must bring the appropriate offering to the temple to apply for forgiveness from the Lord through the sacrificial system that He had instituted for that purpose (Matthew 5:23-24).
And he shall bring his trespass offering unto the LORD, a ram without blemish out of the flock, with thy estimation, for a trespass offering, unto the priest: And the priest shall make an atonement for him before the LORD: and it shall be forgiven him for any thing of all that he hath done in trespassing therein. - Leviticus 6:6-7
In this way, restitution or reparation to a neighbor for wrong done is a requirement for the appeal to God for forgiveness. It is a tangible demonstration of repentance and as much a part of an appeal to God as the trespass offering brought to the priest in the temple. It is in this spirit that John the Baptist chastised the Pharisees and Sadducees to "bring forth fruit in keeping with repentance" (Matthew 3:7-9).
God had established the temple and the priesthood as the means by which forgiveness from God could be obtained. And that is the salient point. Forgiveness for sin is sought from God by the means that God has established because all sin is against God. One may apply to God for forgiveness by the means dictated but, it is God (and not the means themselves (Hebrews 10:4)) who forgives. God may deliver forgiveness apart from application through this process (but not absent repentance) but that is his prerogative and not to be demanded or expected by us.
And David said unto Nathan, I have sinned against the LORD. And Nathan said unto David, The LORD also hath put away thy sin; thou shalt not die. - 2 Samuel 12:13
And so Nathan has declared that David is forgiven but the declaration is that the Lord has forgiven. Nathan has not forgiven; he has pronounced the Lord's forgiveness. Likewise the priests in the temple receive application to God by means of sacrifice and confer upon the penitent the Lord's forgiveness. The priest does not forgive; he mediates/procures the Lord's forgiveness. The priest and the prophet are part of the means.
There was a levitical process for a leper to avail himself for healing/forgiveness. One leper bypassed the temple, the priests, and the offerings and went straight to Jesus. When Jesus healed the leper he commanded the man to go to the priests and offer the appropriate sacrifice:
And it came to pass, when he was in a certain city, behold a man full of leprosy: who seeing Jesus fell on his face, and besought him, saying, Lord, if thou wilt, thou canst make me clean. And he put forth his hand, and touched him, saying, I will: be thou clean. And immediately the leprosy departed from him. And he charged him to tell no man: but go, and shew thyself to the priest, and offer for thy cleansing, according as Moses commanded, for a testimony unto them. - Luke 5:12-14
He commands him thus not as an appeal to God for healing but as a testimony to the priests that God's healing took place by the hand of Jesus.
Later, when the paralytic was lowered down to Jesus by his friends this was also done in an environment wherein the temple system was still intact. If healing was sought there was a levitical process in place and specific sacrifice and ritual already in place. When Jesus declared to him "Man, your sins are forgiven you" he was taking the place of the entire Levitical system.
The Pharisees and the teachers of the Law were offended because Jesus pronounced forgiveness himself. He did not proclaim, as the prophets or priests would do, that the Lord had forgiven the man. He pronounced the man "as forgiven" quite apart from the process to apply for forgiveness that God had set in place. He did that which it was only God's prerogative to do and the miracle of healing was confirmation of the same:
And the scribes and the Pharisees began to question, saying, “Who is this who speaks blasphemies? Who can forgive sins but God alone?” When Jesus perceived their thoughts, he answered them, “Why do you question in your hearts? Which is easier, to say, ‘Your sins are forgiven you,’ or to say, ‘Rise and walk’? But that you may know that the Son of Man has authority on earth to forgive sins”—he said to the man who was paralyzed—“I say to you, rise, pick up your bed and go home.” - Luke 5:21-24
This authority is rightly "power" or "ability" and it is not authority to declare God's forgiveness of sin (as prophet and priest might do) but it is authority to forgive sin (as only God can do). This is exactly what the Pharisees recognized and reacted against, “Who is this who speaks blasphemies? Who can forgive sins but God alone?”
Has is the verb εχω (echo) and means to have or hold. Its usage slightly transcends that of the English equivalent. Where our English verb "to have" mostly emphasizes possession and control of external things, our Greek verb mostly describes the set of features that collectively define identity. When someone "has" something (say: an object or property, a quality or condition, a word to say, a feeling, a skill, an obligation or conviction), that something helps to determine who that person is. The Greek verb εχω (echo) sums up the substance of one's reality, it sums up the internal and external qualities of someone or something rather than merely the external things that come in addition to someone or something.
When Jesus declared that the Son of Man "has authority on earth to forgive sins" he is not saying that he wields a power or holds an office that was conferred upon him. He is saying that he, himself, is forgiveness and, since only God can forgive sins, He is God's forgiveness.