Task-agnostic Pre-training and Task-guided Fine-tuning for Versatile Diffusion Planner