Yes, you can continue working your payroll in QuickBooks Desktop (QBDT) while the accounting side will be on QuickBooks Online (QBO). Please know that these two QuickBooks versions will not sync as these are two different platforms with unique features and have their own subscriptions which you'll be paying. Thus, the information you enter in QBDT or QBO will stay on the account where you enter data.
However, you can transfer much of the information from your company file without having to re-enter it manually. But, some pieces of information won’t convert or transfer automatically with your company file like some payroll info because QBDT has more payroll features than QBO.
To transfer your QBDT file to QBO, see the below articles for guidelines: