Assuming a militias purpose was to defend against a military, cannons were something a military had, so were militias allowed to own cannons?
A previous thread with multiple answers covers this pretty well (I highly suggest reading) but the short answer is yes.
Edit: forgot to give credit to u/Evan_Th and u/freedmenspatrol for their answers