How to cap this water pipe so it is flushed with the concrete?
That looks like a cleanout to me. I would cut that thing as close to the concrete as you can with a hacksaw. Then take a die grinder (Dremel Tool) and cut it down to flush from inside the pipe. Then get a Flush Cleanout Repair Plug and secure it with the tool that comes with it. You don't need any glue or any threadings and it will hold up to 50' of back pressure. They are available in several different sizes to fit your needs.