It depends on the situation. Normally, an amendment can be made prior to grant as long as it is considered a minor change and if the application is mutually exclusive, does not create any new conflicts or increase any conflicts. For example, you can make a minor amendment that has no conflicts to break out of an MX group. Such amendments should include a statement that the amendment was done without any consideration (in other words, no one paid you to amend the application).
If an application is dismissed for most reasons other than what would be a fatal flaw (such as as a lack of corporate standing or site assurance at the time of end of the window), applicants can make one amendment nunc pro tunc (like it never happened) to cure the defects of the application. In this case, only one amendment is allowed and no other amendments can be made, even if the application is dismissed again for an unrelated defect.