By running cat test.sh | bash, you replace the stdin of the bash process (which normally is the terminal, thus, "the keyboard") with a pipe file descriptor connected to a cat process writing the contents of test.sh.
But while bash is reading from the pipe to execute the commands in your script, it also executes read -i aaa which reads from stdin as well, and may read the commands which where meant for bash.
That means we probably have undefined behaviour here, unless it is specified in what chunks bash reads its commands.
So, when piping a script to a shell, better not use any commands consuming input inside the script.
And why did the final echo $aaa obviously only print a newline, but not what read read? Because you didn't mean to say read -i aaa, but just read aaa.
It's not so usual to read a shell script from stdin anyway. Just execute as bash test.sh or use a shebang line.
./test.shorbash test.shwget -qO - url | bash