Yes, you can register a trademark even if your application first receives an office action. Office actions are common, and they don’t necessarily prevent your trademark from registration. What they mean is that an examining attorney raised an issue with your current trademark application, and if the issues raised are resolved to the examiner's satisfaction, the application proceeds through publication. From there, if no opposition arises, your application continues to registration.
The outcome depends on the specific grounds raised and the quality of the response. Procedural issues are usually straightforward. Substantive refusals on likelihood of confusion or descriptiveness require persuasive legal arguments and sometimes evidence of co-existence or acquired distinctiveness.