For TP-Link TL-WR940N 4/32 router I have two options:
OpenWRT 18.06.9 version
and current DD-WRT.
According youtube videos basic functionality works.
But main goal is to use adblock/trackblock list.
Will adblock work on such device and what small and effective list should I choose?
Are there smaller alternatives to adblock?
Do I risk to make device unrecoverable?
At what point? Can additional package like adblock make it unbootable?
I successfully installed DD-WRT.
Despite I have WR940N version and I used correct link, firmware inside displays WR941N.
So I suppose OpenWRT WR941N version will also work.
Firewall script solution for adblocking works.
3 . I red that DD-WRT updates are old, OpenWRT 18.06.9 version is also old.
Are there any important points on security?
Many people never update their routers, I can stay with 18.06.9 version if this is not critical.
This device doesn't meet minimum system requirements, and running a current -security supported- release is essential on a border gateway.
Beyond that, adblock lists regularly get very extensive (otherwise they'd be rather pointless), 5-6 figures of blocked domains, this needs RAM, a lot of it - even modest adblock lists can bring down devices with 128 MB RAM, 32 MB doesn't stand a chance (beyond a hand-curated list of a few dozen/ hundreds on entries). Modern OpenWrt releases would actually be even better at dealing with low-RAM situations (although not to this extent, not by an order of magnitude), as dnsmasq has gotten better about dealing with large blocklists - but there's no way to get those booting on your device in the first place.
If you are interested in running OpenWrt, be welcome to do so - but get a device where that makes sense and which will be upgrade safe for the next couple of years (so exceeding minimum system requirements by a healthy margin, 16 MB flash and 256 MB flash (depending on the memory requirements of modern chipsets that may even need to be increased, e.g. at least 512 MB for ipq40xx/ ipq806x, at least 1 GB for ipq60xx/ ipq807x)). A 4/32 device neither can do what you want from it, nor would it provide a representative experience.
OpenWrt is rather conservative when it comes to updating minimum system requirements, it only tends to formally declare older devices 'unsupported' way after beyond the point of which it has become unviable to actually use them 'normally'.
Device/ target deprecation usually happens out of technical necessity, not just pointless political decisions like for some mainstream desktop operating systems.
 and technically, device support doesn't even get removed in most of those cases, just not built officially anymore, leaving open the door for anyone wanting to build their bespoke (stripped down-) image for them for a while longer.
 looking back over the history for the deprecation of 4/16 and 4/32 devices, I'd say 2 major releases at least
 image simply doesn't fit into the available flash anymore or would crash with out of memory conditions while booting/ enabling the wireless