Yes, and this is commonly done, but it takes careful advance planning. All gift giving must be completed at least five years before you submit your application for Medicaid coverage.
You can give direct gifts, but there is another option that may be preferable depending on the circumstances.
If you convey assets into an irrevocable Medicaid trust, five year prior to applying for Medicaid, they would not count if and when you apply. However, if there are income-producing assets in the trust, you could continue to accept distributions of the income.