No, typically you cannot change your name while applying for a green card. It’s generally recommended to apply for the green card under your current legal name and pursue a legal name change separately, which after being legally completed, can be updated on your immigration records.