getElementById not working with AppleScript
Close you need to specify who to tell, in this case document 1

tell application "System Events"
    tell process "Safari"
        tell menu bar 1
            click menu bar item "File"
            tell menu "File"
                click menu item "New Private Window"
            end tell
        end tell
    end tell
end tell

tell application "Safari" 
    open location "https://www.nngroup.com/articles/checkboxes-vs-radio-buttons/"
    delay 3
    tell application "System Events" to keystroke space
    tell document 1
        do JavaScript "document.getElementById('two').click();"
    end tell
end tell


Also when working with radio buttons, I would suggest:

document.getElementById('two').checked = true;


Also you can escape quotes (don't need to in this example, but good to know)

do JavaScript "document.getElementById(\"two\").checked = true;"