You certainly can.
What makes your example odd is that "be important" does not readily accept an infinitive clause as its subject, though it does as complement:
? To make friends is important.
It is important to make friends.
But with other words, it is fine. WS2 gives the exmple of the proverb "To err is human, to forgive divine". But you can come up with more ordinary examples. For example.
To talk to my boss was what I wanted to do all morning.
In sentences like that, it is fronted for emphasis: a more neutral version would be "All morning I wanted to talk to my boss".
Yosef Bskinh mentions a different construction starting with an infinitive: an initial purpose clause. "To make an omelette" = "In order to make an omelette".