Yes, but you'll need to sell the assets in the UGMA/UTMA account and pay any applicable taxes, fees, and expenses. At that point, you can invest the cash in an UGMA/UTMA (custodial) 529 plan account. An UGMA/UTMA 529 plan account will be subject to the rules for both types of accounts, including applicable UGMA/UTMA state statutes. You cannot change the beneficiary of an UGMA/UTMA 529 plan account.
You may want to consult a tax professional regarding your specific tax situation.