You may add a WidgetKit extension to an app that targets older OSes. Your WidgetKit extension will not do anything on these OSes and will be stripped out when downloaded to those devices.
You may also use WidgetKit with an app that uses UIKit (or even AppKit, macOS Catalyst, or even Carbon) because the WidgetKit extension is in a separate process from your app. To be clear, however, inside that WidgetKit extension you may only use SwiftUI. (And CoreGraphics if you want to draw into an image context and use SwiftUI's Image)