How to avoid a duplicate membership for same contact
I suspect the OP needs to avoid the creation of double backend membership with the same type. Something which would look like -



This could be a bug(not sure) as this doesn't happen when registered through contribution pages. I don't think there is any setting in civi UI which would avoid this, but it is possible with a small extension(learn here) where you need to check for double membership type registering for a single contact id.