The origin of the rubber duck is largely a mystery. There is very little information about them and the few sources out there actually have conflicting opinions.
The most common story about the first rubber duck is that they were created by Peter Ganine in the 1940s. He filed a patent for the design in 1947 and it was approved in 1949. However, sources claiming he was the first to invent the rubber duck are incorrect; he was definitely not the first, this is just the earliest U.S. patent that anyone has found.
In 1948, Hong Kong toy creator Lam Leung-tim invented a yellow plastic duck in China. This interview claims his duck was in production before Ganine's duck, making him the first. Again, I think this is wrong too.
I personally think the first rubber ducks were invented in the 1930s by the Sun Rubber Company, a popular plastic toy creator back then. My reason for disagreeing with these other researchers is based on something I found myself. The 1934 film "Imitation of Life" opens with a child playing with a rubber duck in a bathtub. Here's a screenshot. I believe that duck is made by Sun Rubber Company because it looks very similar to this design, though the earliest date I've seen for these ducks says they were from 1939. At the very least, it goes to show that people dating rubber ducks to the 1940s are incorrect and we don't really know much about their origin.
Followup: What about rubber chickens? I don't think the younger generations might be aware of it, but rubber chickens were a staple in American comedy (and possibly other countries?) for decades. There's nothing particularly funny about them that stands out from any other prop yet they were the go-to comedy prop in stand up routines, cartoons, television shows, and movies up until fairly recently.