If you had read the PDF, 5ms is the "minimum touch time", which is not latency, but a minimum touch time it can register.
The same software has no problem rendering complex games and doing all kinds of game logic, all in 16.7ms. What makes you think asking for a touch input will take 15 times longer?
I already gave you an example of software stack impact on latency - Android sound lag went down from >250ms to respectable 10ms for some Nexus devices. Blame buffers.