Yes, stub files can be created for third-party libraries and used in your own codebase. Many popular Python libraries already have stub files available, and you can also create your own stub files for any libraries that you use.