No, there's no way for an external function to access the local variables defined in a function.
There are several ways to solve the problem you have without that though. You could make the variables defined in __init__ instance variables (attributes of self) and make sure your external function can access the right instance (perhaps in a global variable).
Or you could define a function within the __init__ function. Such a closure can access the variables defined in an outer namespace without issue. In your specific instance, you could even make the closure a really small one, using lambda to call the "real" outer function with an argument:
class MainApp(tk.Tk):
    def test(test_entry):
        a = test_entry.get()
        print(a)
    def __init__(self, *args, **kwargs):
        tk.Tk.__init__(self, *args, **kwargs)
        test_entry = tk.Entry(self)
        test_entry.pack()
        submit_button = tk.Button(self, text="Submit", command=lambda: MyApp.test(test_entry))
        submit_button.pack()
The expression lambda: MyApp.test(test_entry) defines an unnamed function that keeps hold of the test_entry defined in the namespace of the __init__ method. When the lambda function is called, it passes that value on to the test function. You could also move the whole test definition into the __init__ method, and so call it directly, without a lambda, but that is often ugly as it involves lots of deep indentation.