Hello Varun,
Thank you for reaching out to Microsoft Support!
Please try using the $search parameter, the url is below, please see the documentation for details:
https://graph.microsoft.com/v1.0/me/messages?$search="from:******@domain.com" or "recipients:******@domain.com"
Hope this helps.
If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.