You can use both, but the usage and meaning are slightly different:
Puis-je aller aux toilettes ?
You are asking the permission to leave the room/discution/whatever. You may ask it to your teacher, your boss, the person animating a meeting... A disagree would look like "Attendez 5 minutes, je finis la diapo et on fera une pause", something about why you can't leave
Puis-je utiliser les toilettes ?
You are asking to the owner of the house if you can use the restroom. Not if you can leave the actual meeting. So can't say that if the person you're asking to doesn't own/rent the place (or if the owner set him responsible of the party for instance...). A disagree would look like "Désolé les toilettes sont en travaux", or a technical reason not to be able to go to the toilet.