If a joke is a century old and you've heard it told a hundred times, you can reuse it. You can modify it, you can build on it - by this point it's not "owned" by anyone. Trouble is, by this point your readers have also heard this joke a hundred times. Sometimes it can work - in a sci-fi setting, an old joke might have changed to accommodate aliens, new technology etc., but the readers can still relate to it because of the underlying familiar shape. This is something that happens to jokes in real life too - they change over time. (Actually, not only sci-fi setting. You can do the same with a setting that's far in the past. Mel Brooks did it sometimes.)
If a joke is not that old, it's not good to steal it, as @ChrisSunami points out. And you really don't need to be doing that. If your character is to be funny not only in-story, but to the readers, they need to be original. If you found something funny on the internet, chances are your readers have too, and a character who's made of not-so-fresh jokes isn't really funny.
Instead, try to put yourself in the character's situation, and find what you can say that's funny in the way you need. That takes more effort, but the result is a character that's your own, with their own unique voice, and with jokes that are tailored for the situation, instead of being rather generic. They might not even be very funny in and of themselves, but funny because of the particular situation, and how it all fits together.
And if sometimes you absolutely can't make up a joke of your own? Once you've established your character, sometimes you can cheat: once in a while, you can tell instead of showing. "Alex was telling one of his jokes again."