How can It be done? Should I install virtualmin first then update, or what?
I'm not sure what you're asking -- PHP5 comes with CentOS 5.3.
Whenever you run Virtualmin's install.sh script, you'll end up with PHP5 on your system when the installation is complete.
I get php 5.1 installed, I need php 5.2 or php 5.3. How can this be done?
You may want to take a look at the VM Bleeding Edge repository, which will have PHP 5.2 in it:
rpm -Uvh remi-release-5.rpm epel-release-5.rpm
yum --enablerepo=remi update php*
yum --enablerepo=remi update mysql*
yum --enablerepo=remi update