If you are charged with a felony DUI and you successfully complete a 30 day inpatient rehab/treatment program before your court case will that help your defense?
It could be beneficial in mitigation for sentencing to help reduce the amount of jail time to which a judge may sentence you (although it will not reduce the mandatory minimum jail time you are still facing for a conviction). Hiwever, it would not offer any help as to your defense against the elements of the offense. Depending on your jurisdiction, you might have a local prosecutor willing to agree to reduce the charges as part of some negotiated guilty plea agreement, although in my experience prosecutors are generally reluctant to reduce felony DUI charges.
It will not help your defense but it could serve as a good point of mitigation with the prosecution or the judge at sentencing.
It certainly won't hurt. It may give your attorney a good argument for your felony dui to be amended to a miss. dui.