Is it ok to continue on a branch if you also merge back main into it?
On some repositories, sure.
But better maintained repositories don't allow merge commits (because merge commits suck), and so will have squashed (or rebased) on merge.
(If squashed) The squash will have changed commit IDs, so a long running branch rebased won't benefit from a clean shared commit history.
So it can work, but "you're gonna have a bad time."
In general, git works best if branches are thrown away as soon and as often as possible.
(Edit: Good clarification in response below, added here for consistency and accuracy.)