No, using Meta Pixel is not against the law. But you have to let people know that you’re collecting their data when they visit your website. This is a rule set by Facebook.