For an employer to put you on a PIP when you have resigned makes absolutely no sense. The purpose of a PIP is to set standards for your work, where if you meet them you can stay working and if you don't they can terminate you for underperformance. Since you are leaving there is no possibility that you will stay.
The only possible reason for putting you on a PIP is so that they can make you leave early. (Possibly it may be an ego thing where they want to be able to say they fired you, to make it seem like nobody ever leaves the company voluntarily).
Start by making sure all communication has been done in writing. Do everything in writing in the future. Make sure you keep copies of all relevant communication somewhere where you can access it if you were suddenly shut out of the workplace communication system. If you are told anything orally ask for it in writing, and if they don't do that sent them an email repeating what they said to you.
Here is what you do:
- Go to your new company and tell them you may be able to leave earlier than you previously thought. Find out how soon you could start with them if you suddenly became free.
- Talk to HR about the PIP process. Find out how long it will take, whether the conditions are negotiable, if there is an appeal process. If it will take longer than the notice period ask if they really want to do it?
- Go to your boss and ask what outcome they are looking for from the PIP. What in their world would be the best thing that could happen for them? Point out the obvious, that your passing the PIP and staying is not going to happen. Ask explicitly if they would prefer you to leave earlier than your notice period? If your boss is uncooperative have the same conversation with HR. Remind them this is more work for your boss and for HR - do they really want to do all that extra work for something so pointless?
- If they say they would prefer you to leave earlier, tell them you can do that (assuming that the answer from step 1 was favourable). Negotiate a deal where you get to leave earlier and can start at the new company earlier (don't say anything about your new company start date in the negotiations.) Ideally negotiate a deal where you get a bit of extra money for agreeing to leave early -after all you are saving the company money by leaving early.
What I mean by the ideal deal is this: Let's say you were supposed to give 4 weeks notice. Let's say your new company is ready for you to start whenever. You negotiate a deal with your company that the notice period is cut to 1 week, and they pay you an extra week after that. The company saves 2 weeks of your pay, you get an extra week of pay, and you get to start at the new company sooner. It's a win win.
If they totally refuse to change the PIP, comply with it's terms if they don't involve any extra effort from you. Show up to PIP meetings, fill in the necessary forms for HR, don't take it too seriously. Push back against the terms of the PIP just like you would if you were staying. Don't accept a PIP that is harsher on you than on the others in your team who are staying, or which is unreasonable to achieve.
In all of this carry on doing your work to the same standard you've been doing it previously.
And to answer your question, yes they can. There is no law that prevents employers from doing pointless and stupid things. If there was the world would be a very different place.