1. Working as a real estate agent or owner of an agency is permissible because the main line of business is helping people buy (sell) real estate properties. What is prohibited in Shari’ah is taking interest, giving it, writing it and be a witness to its contract. It is not forbidden to help people buy and sell properties. Of course, two things are Haram to write an application for forbidden interest-based loan (a buyer my be under conditions of necessities and hence its loan may not be forbidden) and to help sell a stolen property. These must be avoided by any agent, whether is real estate or other businesses.
2. The same apply on the referral because in referral you are also helping in buying and selling, and it is none of your business how the buyer is going to finance her/his purchase or whether the other agent is going to help in writing the loan application and you are not required to investigate what other people (agent or buyer) are going to do or how are they going to proceed in their relationships.
In both cases taking commission is Halal, In ShaAllah.
In referral there is another point that must be clear, when one refers a friend who comes to us on the basis of trust and confidence and you refer her/him and take commission the referred friend should know that in referring her/him to that specific agent you will get a commission if she/he does not know that and take your advice as friendly trust basis advice such a commission is deserved to the friend not to you. You can’t be a paid adviser without the recipient of the advice be knowing that you are paid, i.e., you have an interest in this advice.