Here we have Meta Stack Exchange:
The "Ask Question" button is part of the "search results" group. Could this possible confuse users? Should site-wide "main" buttons always be placed on the header bar?
Yes. I think it could confuse users, but difficult to say without usability testing with end-users. You'll definitely want to avoid hard-and-fast rules like "site-wide "main" buttons should always be placed on the header bar" ... no, "always" is too strong, but looking at established design patterns you'll generally find that action buttons, e.g., "Ask Question" are found below search, not above as you have here. Sticking to common conventions is better for usability, so I would make that adjustment.