There’s no law against it, but some employees may feel that announcing their birthday violates their privacy. While it’s great that you want to recognize your employees and celebrate with them, I recommend not announcing an employee’s birthday without first getting their permission.
In the case of announcements on public social media, I would get a signed acknowledgement that the employee has given you permission to share their birthday and that their doing so is completely voluntary. Announcing birthdays on public social media pages is a little riskier because they can be seen by everyone.
You could instead make the announcements internally (still with permission). Popular approaches include email, newsletter, or intranet. Many offices have a birthday celebration each month, such as a gathering with cake, ice cream, or cupcakes, and announce the employees who have birthdays during that month without mention of their exact birthday. This is a way to celebrate employees and increase comradery and morale, while avoiding shining too bright of a spotlight on any given employee on a particular day.