Dogs peeing on their beds can be behavioural or a sign of a medical problem. If your dog is weeing in his sleep or while lying down it is likely that this could be a urinary tract infection and it's important you contact your vet.
A Yorkshire Terrier puppy sleeping in its bed at night
Your dog peeing on his bed could be behavioural; if he has done it once and then his bed smells of wee he will continue to urinate there as he now thinks his bed is where he should wee. Clean the bed as soon as you notice the smell so that he doesn't continue.