Of course, that is definitely fine. On the other hand, it is very official, as an example with letters having to do with legal matters. Significantly less formal plus more common is "Dear Sir or Madam:" (Be aware the usage of the colon; "To whom it may well concern:" also https://familylawyerinkarachi59482.wizzardsblog.com/36553289/the-5-second-trick-for-legal-notice-lawyer-karachi