If I buy or sell shares on Ex-Date of Dividend announcement, Do I receive the dividend? What is the record date?

Yes.

You just have to keep below scenarios in mind:

Buyer: Eligible to receive dividends if bought before ex-date. Not eligible for dividends if bought on or after ex-date.

Seller: Eligible for dividends of sold on or after ex-date. Not eligible for dividends if sold before ex-date.