Dolly, as Barbara calls him, is a professor of Greek—so you probably won't be surprised to hear that he's a pretty smart guy. It's probably because of his smarts and interest in the Greeks and their philosophy that he ends up finding his future father-in-law so interesting. Both men love to play with words and ideas—they're two peas in a pod.
Dolly is pretending to be a Salvationist for Barbara's sake, but the only one who seems fooled is, well, Barbara. Dolly's future in-laws definitely have him pegged. As Lady Brit says when she's complaining about Barbara's life choices to Stephen at the very beginning of the play:
And what about Barbara? I thought Barbara was going to make the most brilliant career of all of you. And what does she do? Joins the Salvation Army; discharges her maid; lives on a pound a week; and walks in one evening with a professor of Greek whom she has picked up in the street, and who pretends to be a Salvationist, and actually plays the big drum for her in public because he has fallen head over ears in love with her. (1.31)
Undershaft also later calls out Dolly for playing Salvationist to make Barbara happy.
Despite the fact that Barbara brought him in from off the street and he pretends to be religious, Lady Brit does admit that he will make "a very good husband" (1.33).
In perhaps one of the quickest changes of fortune in the whole of literature (okay, that's probably an exaggeration, but why should the Undershafts get all the hyperbole?), Dolly is revealed as a foundling at the end of the play, which then immediately leads to him becoming the heir to the Undershaft family business.
But wait, let's back up—you probably want to know how exactly he could turn out to be a foundling. After all, you know Lady Brit did her homework before agreeing to let her daughter marry this guy. Well, it seems that while Dolly's parents are totally legit married in his home country of Australia, England wouldn't recognize that marriage because his mother was also the sister of his father's first wife (follow all that? Good).
So, he's technically a foundling in England—which is good enough for Undershaft to offer him the role of heir. Of course, Dolly isn't sure he wants to accept the offer and others, like Stephen, have their doubts as well. However, Dolly eventually declares himself up to the challenge:
STEPHEN [very seriously to Cusins] Dolly, old fellow, think. Think before you decide. Do you feel that you are a sufficiently practical man? It is a huge undertaking, an enormous responsibility. All this mass of business will be Greek to you.
CUSINS. Oh, I think it will be much less difficult than Greek. (3.396-397)
In fact, he even manages to bargain with Undershaft to get far more money than he would have actually required to take on the firm. Of course, he struggles with his own morals and how to reconcile them as he switches from professor to weapons maker, but after some philosophical gymnastics, he comes to the conclusion:
I think all power is spiritual: these cannons will not go off by themselves. I have tried to make spiritual power by teaching Greek. But the world can never be really touched by a dead language and a dead civilization. The people must have power; and the people cannot have Greek. Now the power that is made here can be wielded by all men. (3.407)
So, by thinking of the cannon business as a way of making power more democratic, Dolly makes the whole thing palatable to himself, and accepts the heir-ship cheerfully—especially once he realizes Barbara is on board.