Hong Kong adopts a territorial source principle of taxation, which means only assessable profits which arose in or are derived from within Hong Kong is taxable.
There are no set rules to determine the source of profits for every type of business, as it depends on the nature of the profits and the type of transaction.
The broad guiding principle looks at which operations produced the relevant profits, and where these operations took place. Thus, if a mobile app generated profits from customers from the United Kingdom, but was coded in Hong Kong, then because the operations which produced the relevant profits took place in Hong Kong, then the profits from sale of the mobile app is taxable in Hong Kong.
And because Hong Kong has entered into a Double Tax Relief agreement with the UK, those profits are only taxed once. You can find more information about Double Tax Relief on the government website, as well as see the countries with an established agreement, and also the countries for which negotiations are under way.