Yes, you are welcome to edit a question to improve it on behalf of the person asking.
However, I'd keep in mind these things.
DON'T
Don't edit the question because you believe the person asked the wrong question, or has chosen the wrong way to try and solve a problem. Your edit should help to improve the question they actually intended to ask, not to change it to something they didn't intend to ask.
Occasionally someone changes their mind about what they intend to ask after they've written the question. Ideally, they should ask it as a separate question. However, if they already have answers and have commented about their altered question, then this is no fault of yours and for the benefit of others I would not be against adding this information within the question body, since you are still technically helping them ask the question they now intend to ask. You can also flag for moderator intervention if you think it's warranted (eg, if you think others will be confused).
Don't edit the question to add the answer or solution - this must be added as an answer.
Don't make trivial edits that won't help them get any better answers.
DO
Interpret their question and try to more clearly convey what they intended to ask.
Add important information that the question asker failed to provide, but which became apparent later (eg in comments).
Fix formatting or terminology that might make it difficult for others to understand their question.
Ultimately what you do in your edit is up to you, and if the person asking the question doesn't like the edit, they can reject and/or reverse it (or it can be reversed by someone else). But these tips can help reduce the chances that someone takes issue with your edit.