In P(x) , x is free variable. However when we quantify them using any quantifier we can not assign a value to x. Now x refers to domain. So after quantification the variable is dummy its name does not matter whatever the name is it will refer to domain. Therefore it is called a dummy variable.
∀xP (x) ∨ ∀xQ(x) : in any proposition the variable refers to its nearest quantifier. Therefore the X in P(x) and X in Q(x) are different. To avoid confusion we can change any one variable name to another name. You can watch go classes discrete mathematics lecture they are free and this concept taught there very well.
After changing the name : ∀xP (x) ∨ ∀yQ(y). We can take for all Y to the front it is not affecting anything else in the proposition.
To show the same non empty domain. I believe you need to take example.
P(x): Even , Q(y):prime, Domain : N