A linear voltage regulator such as the LM338k works by dissipating all power that is not delivered to the output as heat. Thus, the more the voltage is dropped, the more heat is dissipated. The current is not increased; you will dissipate (23-5)V*2A = 36W of heat at 2A, and get 5V at 2A at the output.