A foreigner is allowed to form a Company and act as a sole director/shareholder. However, they are required to fulfil the requirement of having residential address in Malaysia.