Can I sell stock on the ex-dividend date?

Yes, you can sell stocks on the ex-dividend date and still receive the dividend.