Could recent 'ordinals' congestion be considered as an attack to blockchain? If so, how easy is it to upload a virus into blockchain itself?
The blockchain is just a public ledger where BTC tx's are stored, every mined block containing all confirmed tx's right from the start of the network is stored in the blockchain. Take note that the blockchain do not contain BTC's in itself or anything that you can steal, that is why it is open and anyone can download their own copy.
Ordinals is not an attack on BTC's security, but it can be called an 'attack' on BTC's use as a currency, because it makes tx's fees to rise, making it impossible for people to use BTC as a currency.