Well, strictly speaking they don’t mean exactly the same thing, but both are used to form sentences in the past. Wnes i ddim means I didn’t, and do’n i ddim means I wasn’t.
The “didn’t”-form is used for verbs that describe (short) actions, and the “wasn’t”-form is used for describing states, or something that happened over a longer period of time.
Wnes i ddim cau’r drws. – I didn’t close the door.
Do’n i ddim yn gwybod hynny. - I didn’t know that.
In English, both are translated as “didn’t”, but for the second example the Welsh is closer to “I wasn’t knowing that” – which is not a natural sounding sentence in English.