The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
I want to filter BUG present in two different projects using a single query
This is very easy with Jira Advance Search (JQL Search) - https://confluence.atlassian.com/jirasoftwareserver/advanced-searching-939938733.html
Query in your case will look like this (if you have two project with key AAA, BBB) -
project in ("AAA", "BBB") AND issuetype = Bug