Yes you can. There's an excellent article in The Independent that explains things very clearly with no ambiguity. One of the points being yours about when you can take the test on arrival:
I thought I had to take the test on day two:
That is a widely held but mistaken view. You can take the test any time from immediately after arrival in the UK to the end of the second full day after arrival.
There will be a strong incentive to have the test at the airport. While PCR tests take much longer to analyse than the lateral flow variety, some airport testing centres can process the results in less than three hours, allowing travellers to leave self-isolation soon after arrival in the UK.
Full article with further info that may be of use here:
Travellers to the UK must take a pre-departure test and, when they arrive, self-isolate until their post-arrival PCR delivers a negative result
www.independent.co.uk