If you are using GNU grep, you can use the \s symbol from PCRE which matches any whitespace, so \s* will match 0 or more whitespace characters:
$ printf 'x\r\nxx\n' > file
$ grep --color=no -P 'x\s*$' file
xx
Note that what looks like an empty line isn't actually empty, it's the \r which is causing the terminal to move back and overwrite the x*. You can see it in action with od:
$ grep -P 'x\s*$' file | od -c
0000000 x \r \n x x \n
0000006
If you don't have GNU grep, you can use the POSIX character class [:space:] in the same way:
$ grep 'x[[:space:]]*$' file | od -c
0000000 x \r \n x x \n
0000006
Removing the \r is also easy with standard tools like tr or sed:
$ tr -d '\r' < file | grep 'x$'
$ tr -d '\r' < file | grep 'x$'
x
xx
$ sed 's/\r//' file | grep 'x$'
x
xx
* Note that, as explained by @dave_thompson-085, this only happens because I have my grep aliased to grep --color=auto which means that color codes are printed around the x, and that's what is causing the x to be overwritten as the \r causes the terminal to move back the cursor, so the x is then overwritten by the non-printing color escape codes.