Yes, as long as you purchase the stock before the Ex-Dividend date you are entitled the dividend declared. In the case of Comfort & Delgro, the is on 20 Aug 2021 so as long as you buy the share before 20th Aug 2021, you are entitled the interim dividend of 2.1 cts per shares which will be paid on 2nd Sep 2021.