If you do a good work with the expectation of reward, does that really make it a good work?
Certainly: any volitional response by a person is a "work," and no one is saved while they are comatose, but when by God';s grace they believe on the Lord Jesus to save them on His account.
The issue is whether man's response to grace and by grace merits him salvation, or whether this is by his faith being counted for righteousness and made accepted in the Beloved on Christ's account, and the answer is the latter.
However, since faith and works go together then one can be promised salvation if they believe as well if they something which faith effects, such as being baptized. But God can see saving faith before it does its works, and declare one righteous, and which is vindicated when they obey.
Sure; why not?
"If you do a good work TO RECEIVE A reward" is an entirely different animal.