Yes you can take them with you but you just to be discrete about it so nobody sees you take them.
There's nothing illegal about taking the used diapers from the public trash can but it may make someone weirded out about you.
There's nothing really wrong with taking baby diapers from a public restroom if they are used.
When I was a kid I would sometimes find used diapers that were wet and would bring them home and put them on or I would take the wet diaper out of the trash can and then take it to a stall and put it on and then walk around in the wet diaper.
Now I no longer do it but I do love looking into the trash cans to see if there's other adult diapers or even toddler or baby diapers in them.
I have touched them before as I love feeling a squishy wet diaper.
I think a guy known as Pamperchu used to or still does also take wet or dirty diapers out of trash cans and then I think he said he microwaves them.