It can not. The last camp is located at the foot of the Inca trail, the place called ruins bridges, there you can rent carapas from the Ministry of Culture is 1h30 walk before reaching Machu Picchu. If you want to know only Machu Picchu you must take the train back and forth to Cusco, you will have to sleep in a hotel in the town of Aguas Calientes that is at the foot of the mountain of Machu Picchu also known as Machupicchu town, there are many hotels in different costs