There is no reason why you could not fit a UPVC door into an existing porch, but it will depend on the frame thickness and as it will need to be compatible with the design that you choose. Speak to your local installer for further advice.
Your new UPVC door and frame system typically come as a single unit, so the old door and its frame will need to be removed prior to fitting. If the porch was a single unit, this may cause problems, however your installer will be able to talk you through the whole process when they provide you with a quote.
Provide that the door you choose is the same size and shape as your previous one, there will not typically be any issue with fitting the replacement into the existing gap, and the frame can be secured to the porch frame in the same way as the previous door was attached.
As part of the survey process, your installer will tell you whether there are any potential issues with the existing porch that might affect the new door - for example if the frame is very old and requires attention.