Yes, if you are selected in the diversity lottery, you will be able to confer that benefit to a new spouse as long as you get married before entering the US on the immigrant visa, or adjust status to permanent residence if you are in the US.  However, be aware that only someone who is in the US in lawful status will be eligible for benefits under the diversity visa program.