alnilam;
Ese código no va entre <body> y <body> sino dentro del mismo <body> tal como es el código mismo y quedaría así:
<html>
</head>
<body oncontextmenu="alert('TEXTO');return false">
</body>
</html>
Funciona perfectamente